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

Improve error message for unsupported character in SpEL expression #30602

Closed
sbrannen opened this issue Jun 6, 2023 · 0 comments
Closed

Improve error message for unsupported character in SpEL expression #30602

sbrannen opened this issue Jun 6, 2023 · 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 Jun 6, 2023

Overview

If the Spring Expression Language (SpEL) parser encounters a character that it does not support, the current error message is not very helpful.

For example, if an identifier (i.e., property name, variable name, etc.) contains a character with an umlaut such as ü, the error message is currently: Cannot handle (252) 'ü'.

In such cases, we should craft a more meaningful error message such as: Unsupported character 'ü' (252) encountered at position 13 in expression.

Related Issues

@sbrannen sbrannen added in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement labels Jun 6, 2023
@sbrannen sbrannen added this to the 6.0.10 milestone Jun 6, 2023
@sbrannen sbrannen self-assigned this Jun 6, 2023
mdeinum pushed a commit to mdeinum/spring-framework that referenced this issue Jun 29, 2023
Prior to this commit, when an unsupported character such as "ü" was
encountered in a SpEL expression, the error message was:

Cannot handle (252) 'ü'

With this commit, the error message is now similar to:

Unsupported character 'ü' (252) encountered at position 5 in expression.

See spring-projectsgh-30580
Closes spring-projectsgh-30602
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