Browse Source
FunctionReference in the Spring Expression Language (SpEL) currently does not unwrap an InvocationTargetException; however, ConstructorReference and MethodReference do. For example, currently one may encounter an exception like the following, where the 'null' comes from the fact that an InvocationTargetException doesn't always have a message. SpelEvaluationException: EL1023E: A problem occurred whilst attempting to invoke the function 'formatObjectVarargs': 'null' To address that, and to align with the behavior of ConstructorReference and MethodReference, this commit modifies FunctionReference so that it unwraps the InvocationTargetException to use its cause for the exception message, resulting in an exception message like the following. SpelEvaluationException: EL1023E: A problem occurred whilst attempting to invoke the function 'formatObjectVarargs': 'Format specifier '%s'' Closes gh-33174pull/33181/head
1 changed files with 5 additions and 2 deletions
Loading…
Reference in new issue