Class: ODataParseError
Defined in: packages/core/src/parser/errors.ts:16
Thrown when the lexer or parser encounters malformed OData query syntax.
The position field indicates the character offset in the input string where the error was detected. The token field (if available) holds the token that triggered the error.
Note: position info is intentionally included — the input is the user's own query string, not server-internal data, so there is no information disclosure risk.
Extends
Error
Constructors
Constructor
new ODataParseError(
message,position,token?,queryContext?):ODataParseError
Defined in: packages/core/src/parser/errors.ts:17
Parameters
message
string
position
number
token?
unknown = null
queryContext?
string
Returns
ODataParseError
Overrides
Error.constructor
Properties
position
readonlyposition:number
Defined in: packages/core/src/parser/errors.ts:19
queryContext?
readonlyoptionalqueryContext?:string
Defined in: packages/core/src/parser/errors.ts:21
token
readonlytoken:unknown=null
Defined in: packages/core/src/parser/errors.ts:20
Methods
withContext()
staticwithContext(message,position,queryString,token?):ODataParseError
Defined in: packages/core/src/parser/errors.ts:41
Create an ODataParseError with a context snippet extracted from the query string. Extracts ~20 characters before and after the error position for diagnostic context.
Per threat model T-12-05: context snippet shows only the user's own query input (already known to them) — never includes stack traces or internal paths.
Parameters
message
string
Base error message
position
number
Character offset where the error was detected
queryString
string
The full query string for context extraction
token?
unknown = null
Optional token that triggered the error
Returns
ODataParseError