added debug when parsing fails

This commit is contained in:
Adrian Cole 2012-08-19 19:50:27 -07:00
parent 169006b3ed
commit 8c5e03a9a5
1 changed files with 5 additions and 5 deletions

View File

@ -43,14 +43,14 @@ import com.google.inject.name.Named;
*/
@Singleton
public class JAXBParser implements XMLParser {
/** Boolean indicating if the output must be pretty printed. */
private Boolean prettyPrint;
@Inject
public JAXBParser(@Named(Constants.PROPERTY_PRETTY_PRINT_PAYLOADS) String prettyPrint) {
super();
this.prettyPrint = Boolean.valueOf(prettyPrint);
super();
this.prettyPrint = Boolean.valueOf(prettyPrint);
}
@Override
@ -81,7 +81,7 @@ public class JAXBParser implements XMLParser {
Unmarshaller unmarshaller = context.createUnmarshaller();
return (T) unmarshaller.unmarshal(reader);
} catch (Exception ex) {
throw new IOException("Could not unmarshall document", ex);
throw new IOException("Could not unmarshall document into type: " + type.getSimpleName() + "\n" + xml, ex);
}
}
}