Skip to content

Unwrap InvocationTargetException in SpEL's FunctionReference #33174

Closed
@sbrannen

Description

@sbrannen

Overview

While working on #33013, I noticed that we don't unwrap an InvocationTargetException in SpEL's FunctionReference; however, we do unwrap those in ConstructorReference and MethodReference.

For example, currently one may encounter an exception like this:

SpelEvaluationException: EL1023E: A problem occurred whilst attempting to invoke the function 'formatObjectVarargs': 'null'

That 'null' comes from the fact that an InvocationTargetException doesn't have a message. Instead, we should unwrap the InvocationTargetException to use its cause for the exception message, resulting in something like this:

SpelEvaluationException: EL1023E: A problem occurred whilst attempting to invoke the function 'formatObjectVarargs': 'Format specifier '%s''

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions