Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unwrap InvocationTargetException in SpEL's FunctionReference #33174

Closed
sbrannen opened this issue Jul 9, 2024 · 0 comments
Closed

Unwrap InvocationTargetException in SpEL's FunctionReference #33174

sbrannen opened this issue Jul 9, 2024 · 0 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@sbrannen
Copy link
Member

sbrannen commented Jul 9, 2024

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''

@sbrannen sbrannen added in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement labels Jul 9, 2024
@sbrannen sbrannen added this to the 6.2.0-M5 milestone Jul 9, 2024
@sbrannen sbrannen self-assigned this Jul 9, 2024
artembilan added a commit to spring-projects/spring-integration that referenced this issue Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant