Class BeanQuerySyntaxException

All Implemented Interfaces:
Serializable

Thrown when a $-search expression names an unknown operator or is otherwise malformed (an unclosed parenthesis, a wrong argument count, junk after the close paren, an empty expression, and so on), or when a higher-level check (column allow-list, sort keys, paging, regex policy, operator/type mismatch, an unparseable typed value) rejects a caller-supplied query.

The single public parser (SearchExpressionParser) throws this for every syntactic problem; the #1/#2 validation pipeline throws it for every semantic one. Every instance carries a stable BeanQuerySyntaxException.Code: messages are for people, code() is for callers (an HTTP error body, the JS engine, a test corpus) that need to branch on *which* problem occurred without parsing the message.

Example:

try { SearchExpressionParser.parse("$foo(1)", SearchOperatorSet.standard()); } catch (BeanQuerySyntaxException e) { if (e.code() == BeanQuerySyntaxException.Code.UNKNOWN_OPERATOR) log.warn("Unknown operator: {}", e.getMessage()); }

Since:
10.0.0