Commit cf3bc340 authored by Chris Lamb's avatar Chris Lamb 💬

Display the reason when cannot extract metadata from PDF files.

parent 16d519a9
......@@ -63,8 +63,8 @@ class PdfFile(File):
def dump_pypdf2_metadata(file):
pdf = PyPDF2.PdfFileReader(file.path)
except PyPDF2.utils.PdfReadError:
return "(Could not extract metadata)"
except PyPDF2.utils.PdfReadError as exc:
return "(Could not extract metadata: {})".format(exc)
xs = []
for k, v in sorted(pdf.getDocumentInfo().items()):
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment