Improve InvocableHandlerMethod error handling
This commit improves the fix for gh-18491 for Java 18 as in this case the exception message might not be null.
This commit is contained in:
@@ -206,7 +206,8 @@ public class InvocableHandlerMethod extends HandlerMethod {
|
||||
}
|
||||
catch (IllegalArgumentException ex) {
|
||||
assertTargetBean(method, getBean(), args);
|
||||
String text = (ex.getMessage() != null ? ex.getMessage() : "Illegal argument");
|
||||
String text = (ex.getMessage() == null || ex.getCause() instanceof NullPointerException)
|
||||
? "Illegal argument": ex.getMessage();
|
||||
throw new IllegalStateException(formatInvokeError(text, args), ex);
|
||||
}
|
||||
catch (InvocationTargetException ex) {
|
||||
|
||||
Reference in New Issue
Block a user