Skip to content

Commit

Permalink
Use JsonIOException for unchecked exceptions instead of RuntimeExcept…
Browse files Browse the repository at this point in the history
…ion in ConstructorConstructor
  • Loading branch information
panic08 committed Oct 29, 2024
1 parent 44c9336 commit cde8922
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -270,15 +270,13 @@ private static <T> ObjectConstructor<T> newDefaultConstructor(
// Note: InstantiationException should be impossible because check at start of method made
// sure that class is not abstract
catch (InstantiationException e) {
throw new RuntimeException(
throw new JsonIOException(
"Failed to invoke constructor '"
+ ReflectionHelper.constructorToString(constructor)
+ "' with no args",
e);
} catch (InvocationTargetException e) {
// TODO: don't wrap if cause is unchecked?
// TODO: JsonParseException ?
throw new RuntimeException(
throw new JsonIOException(
"Failed to invoke constructor '"
+ ReflectionHelper.constructorToString(constructor)
+ "' with no args",
Expand Down

0 comments on commit cde8922

Please sign in to comment.