Skip to content

Exceptions

Each of the following exceptions has a token property, referencing the Token that caused the error. You can use Token.position() to get the token's line and column number.

jsonpath.JSONPathError

Bases: Exception

Base exception for all errors.

PARAMETER DESCRIPTION
args

Arguments passed to Exception.

TYPE: object DEFAULT: ()

token

The token that caused the error.

TYPE: Optional[Token] DEFAULT: None

jsonpath.JSONPathSyntaxError

Bases: JSONPathError

An exception raised when parsing a JSONPath string.

PARAMETER DESCRIPTION
args

Arguments passed to Exception.

TYPE: object DEFAULT: ()

token

The token that caused the error.

TYPE: Token

jsonpath.JSONPathTypeError

Bases: JSONPathError

An exception raised due to a type error.

This should only occur at when evaluating filter expressions.

jsonpath.JSONPathIndexError

Bases: JSONPathError

An exception raised when an array index is out of range.

PARAMETER DESCRIPTION
args

Arguments passed to Exception.

TYPE: object DEFAULT: ()

token

The token that caused the error.

TYPE: Token

jsonpath.JSONPathNameError

Bases: JSONPathError

An exception raised when an unknown function extension is called.

PARAMETER DESCRIPTION
args

Arguments passed to Exception.

TYPE: object DEFAULT: ()

token

The token that caused the error.

TYPE: Token