[fix] handle content error in pdf.py
This commit is contained in:
parent
61744e4bf5
commit
6bfd4138cf
1 changed files with 4 additions and 1 deletions
|
|
@ -39,7 +39,10 @@ def get_pdf(html, options=None):
|
|||
filedata = fileobj.read()
|
||||
|
||||
except IOError, e:
|
||||
if "ContentNotFoundError" in e.message or "ContentOperationNotPermittedError" in e.message:
|
||||
if ("ContentNotFoundError" in e.message
|
||||
or "ContentOperationNotPermittedError" in e.message
|
||||
or "UnknownContentError" in e.message
|
||||
or "RemoteHostClosedError" in e.message):
|
||||
# allow pdfs with missing images if file got created
|
||||
if os.path.exists(fname):
|
||||
with open(fname, "rb") as fileobj:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue