Skip to content
Snippets Groups Projects
Commit cf3bc340 authored by Chris Lamb's avatar Chris Lamb :eyes:
Browse files

Display the reason when cannot extract metadata from PDF files.

parent 16d519a9
No related branches found
No related tags found
No related merge requests found
......@@ -63,8 +63,8 @@ class PdfFile(File):
def dump_pypdf2_metadata(file):
try:
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()):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment