dblevins commented on code in PR #91:
URL: https://github.com/apache/johnzon/pull/91#discussion_r873201691
##########
johnzon-mapper/src/main/java/org/apache/johnzon/mapper/MappingParserImpl.java:
##########
@@ -373,11 +377,20 @@ private Object buildObject(final Type inType, final
JsonObject object, final boo
}
Object t;
- if (classMapping.factory.getParameterTypes() == null ||
classMapping.factory.getParameterTypes().length == 0) {
- t = classMapping.factory.create(null);
- } else {
- t = classMapping.factory.create(createParameters(classMapping,
object, jsonPointer));
+ try {
+ if (classMapping.factory.getParameterTypes() == null ||
classMapping.factory.getParameterTypes().length == 0) {
+ t = classMapping.factory.create(null);
+ } else {
+ t = classMapping.factory.create(createParameters(classMapping,
object, jsonPointer));
+ }
+ } catch (Exception e) {
+ final String message = String.format("%s cannot be constructed to
deserialize %s: %s%n%s",
Review Comment:
I'm my testing I haven't seen any scenarios where MappingException is
thrown. Issues appear to get wrapped as IllegalStateException before reaching
this catch.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]