Provide more diagnostics when a constructor fails.
This commit is contained in:
parent
94d59b550e
commit
290fb69a50
@ -91,11 +91,12 @@ public final class ConstructorConstructor {
|
||||
return (T) constructor.newInstance(args);
|
||||
} catch (InstantiationException e) {
|
||||
// TODO: JsonParseException ?
|
||||
throw new RuntimeException(e);
|
||||
throw new RuntimeException("Failed to invoke " + constructor + " with no args", e);
|
||||
} catch (InvocationTargetException e) {
|
||||
// TODO: don't wrap if cause is unchecked!
|
||||
// TODO: JsonParseException ?
|
||||
throw new RuntimeException(e.getTargetException());
|
||||
throw new RuntimeException("Failed to invoke " + constructor + " with no args",
|
||||
e.getTargetException());
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new AssertionError(e);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user