Skip to content

Defined in: src/query/errors.ts:103

The node rejected a query.

These codes are part of the frozen arkiv_query surface, so kind and data are stable enough to branch on — which the underlying JSON-RPC error is not, because the codes overlap Ethereum’s own EIP-1474 numbering and get wrapped accordingly on the way up.

try {
await client.query("category = 'docs'")
} catch (error) {
if (error instanceof QueryError && error.kind === "parse") {
console.log(error.data) // { position, expected, got }
}
}
  • Error

new QueryError(kind, code, query, data, detail?): QueryError

Defined in: src/query/errors.ts:113

QueryErrorKind

number

string

unknown

string

QueryError

Error.constructor

readonly code: number

Defined in: src/query/errors.ts:107

The JSON-RPC error code.


readonly data: unknown

Defined in: src/query/errors.ts:109

The machine-readable detail the node sent, if any — e.g. { position, expected, got }.


readonly kind: QueryErrorKind

Defined in: src/query/errors.ts:105

Which failure this is.


readonly query: string

Defined in: src/query/errors.ts:111

The query string that was rejected.