user2103145
user2103145

Reputation: 11

Validate jexl expression when using jexl script before execution

I know if you do try catch on jexl.createScript(expressionStr) and jexl will throw error if the expression is not valid (say, missing parenthesis or not a valid close statement). Is there some library that return detailed reasons of the failure not just the location and character where the parsing fails? Or I need to write a customized one by myself?

Upvotes: 0

Views: 159

Answers (1)

henrib
henrib

Reputation: 364

There is currently no other method to determine if a script is syntactically valid. The exception type (Tokenization, Parsing, Ambiguous), its message and the location should indicate why it is not valid and where; if this is not the case, please provide examples.

Upvotes: 0

Related Questions