Skip to content

Commit 5826428

Browse files
committed
PDFBOX-5660: improve exception messages
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1930225 13f79535-47bb-0310-9956-ffa450edef68
1 parent b9f0ef7 commit 5826428

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -938,22 +938,22 @@ private PropertyType checkPropertyDefinition(XMPMetadata xmp, QName prop) throws
938938
if (!nsFinder.containsNamespace(prop.getNamespaceURI()))
939939
{
940940
throw new XmpParsingException(ErrorType.NoSchema, "Schema is not set in this document : "
941-
+ prop.getNamespaceURI());
941+
+ prop.getNamespaceURI() + ", property: " + prop.getPrefix() + ":" + prop.getLocalPart());
942942
}
943943
// test if namespace is defined
944944
String nsuri = prop.getNamespaceURI();
945945
if (!tm.isDefinedNamespace(nsuri))
946946
{
947947
throw new XmpParsingException(ErrorType.NoSchema, "Cannot find a definition for the namespace "
948-
+ prop.getNamespaceURI());
948+
+ prop.getNamespaceURI() + ", property: " + prop.getPrefix() + ":" + prop.getLocalPart());
949949
}
950950
try
951951
{
952952
return tm.getSpecifiedPropertyType(prop);
953953
}
954954
catch (BadFieldValueException e)
955955
{
956-
throw new XmpParsingException(ErrorType.InvalidType, "Failed to retrieve property definition", e);
956+
throw new XmpParsingException(ErrorType.InvalidType, "Failed to retrieve property definition for " + prop, e);
957957
}
958958
}
959959

0 commit comments

Comments
 (0)