Skip to content

Commit

Permalink
Add XML error to exception message
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinThoma committed Jun 27, 2022
1 parent dc946ff commit 9e46c1f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions PyPDF2/xmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ def __init__(self, stream: ContentStream) -> None:
try:
data = self.stream.get_data()
doc_root: Document = parseString(data)
except ExpatError:
raise PdfReadError("XML in XmpInformation was invalid")
except ExpatError as e:
raise PdfReadError(f"XML in XmpInformation was invalid: {e}")
self.rdf_root: XmlElement = doc_root.getElementsByTagNameNS(
RDF_NAMESPACE, "RDF"
)[0]
Expand Down

0 comments on commit 9e46c1f

Please sign in to comment.