Skip to content

Commit

Permalink
Throw a RuntimeException subclass instead of RuntimeException
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Jul 6, 2023
1 parent d0c6023 commit 0b3a2c8
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -398,17 +398,14 @@ public void fillStatementWithBean(final PreparedStatement stmt, final Object bea
Object value = null;
final Method method = property.getReadMethod();
if (method == null) {
throw new RuntimeException("No read method for bean property "
+ bean.getClass() + " " + property.getName());
throw new IllegalArgumentException("No read method for bean property " + bean.getClass() + " " + property.getName());
}
try {
value = method.invoke(bean);
} catch (final IllegalArgumentException e) {
throw new RuntimeException(
"Couldn't invoke method with 0 arguments: " + method, e);
throw new IllegalArgumentException("Couldn't invoke method with 0 arguments: " + method, e);
} catch (final InvocationTargetException | IllegalAccessException e) {
throw new RuntimeException("Couldn't invoke method: " + method,
e);
throw new IllegalArgumentException("Couldn't invoke method: " + method, e);
}
params[i] = value;
}
Expand Down

0 comments on commit 0b3a2c8

Please sign in to comment.