Skip to content

Class: ODataParseError ​

Defined in: 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: parser/errors.ts:17

Parameters ​

message ​

string

position ​

number

token? ​

unknown = null

queryContext? ​

string

Returns ​

ODataParseError

Overrides ​

Error.constructor

Properties ​

position ​

readonly position: number

Defined in: parser/errors.ts:19


queryContext? ​

readonly optional queryContext?: string

Defined in: parser/errors.ts:21


token ​

readonly token: unknown = null

Defined in: parser/errors.ts:20

Methods ​

withContext() ​

static withContext(message, position, queryString, token?): ODataParseError

Defined in: 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