Skip to content

SpEL: Make EvaluationException more informative with Expression [SPR-10938] #15566

@spring-projects-issues

Description

@spring-projects-issues

Artem Bilan opened SPR-10938 and commented

As far as SpEL is some runtime tool, which evaluation result fully depends of provided context (rootObject, variables etc..), it's not enough to see in theStackTrace just a problem, e.g.

Caused by: java.lang.IllegalArgumentException: Cannot convert value of type [java.util.Date] to required type [int]:

It would be better to see which Expression (at least) causes the problem.

In addition, SpEL is some central tool in the Spring Integration, where one Handler may evaluate not one expression for one call, but different Messages may cause different EvaluationException, but with the same expression.

Something similar there is already in the Spring Integration: https://github.com/spring-projects/spring-integration/blob/master/spring-integration-core/src/main/java/org/springframework/integration/util/AbstractExpressionEvaluator.java#L118
But, it would be better, if core EvaluationException will provide the same.


Issue Links:

Referenced from: commits 014d156

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