IllegalArgumentException is thrown on parsing a bad SpEL expr, while ParseException is expected #33291
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
status: declined
A suggestion or change that we don't feel we should currently apply
Affects: 5.x.x 6.x.x (not sure about older versions)
I'm using Spring Expression Language (SpEL) to allow user to specify customized data filter criteria.
As user can input any text for the criteria, I need validate the input SpEL expression. I did it with function
SpelExpressionParser#parseRaw
and considerParseException
as the signal of bad expression.I found it throws
IllegalArgumentException
for some bad expression.repro code:
error log:
The text was updated successfully, but these errors were encountered: