Skip to content

Commit f35e87d

Browse files
committed
PDFBOX-5660: improve exception message, refactor
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1930142 13f79535-47bb-0310-9956-ffa450edef68
1 parent 02dd1eb commit f35e87d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

xmpbox/src/main/java/org/apache/xmpbox/xml/DomXmpParser.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -627,11 +627,13 @@ private AbstractStructuredType parseLiDescription(XMPMetadata xmp, QName descrip
627627
// Instantiate abstract structured type with hint from first element
628628
Element firstLiDescriptionElementChild = liDescriptionElementChildren.get(0);
629629
nsFinder.push(firstLiDescriptionElementChild);
630-
PropertyType ctype = checkPropertyDefinition(xmp, DomHelper.getQName(firstLiDescriptionElementChild));
630+
QName qName = DomHelper.getQName(firstLiDescriptionElementChild);
631+
PropertyType ctype = checkPropertyDefinition(xmp, qName);
631632
if (ctype == null)
632633
{
633-
throw new XmpParsingException(ErrorType.NoType, "ctype is null, first: " + firstLiDescriptionElementChild +
634-
", DomHelper.getQName(first): " + DomHelper.getQName(firstLiDescriptionElementChild));
634+
// PDFBOX-5649
635+
throw new XmpParsingException(ErrorType.NoType,
636+
"Property '" + qName.getLocalPart() + "' not defined in " + qName.getNamespaceURI());
635637
}
636638
Types tt = ctype.type();
637639
AbstractStructuredType ast = instanciateStructured(tm, tt, descriptor.getLocalPart(), firstLiDescriptionElementChild.getNamespaceURI());

0 commit comments

Comments
 (0)