@somnia-chain/markets-sdk / index / IndexerError
Class: IndexerError
Defined in: packages/sdk/src/errors.ts:164
An indexer (Hasura/Envio GraphQL) request did not complete.
When to use
Use when opting into graceful degradation — this is the error to catch to serve stale or empty UI instead of failing a page. It is safe to treat as transient-or-misconfigured: endpoint down, bad URL, schema drift, timeout.
Gotchas
This ALWAYS means "the read didn't happen" — never "there is no such row".
A point read that finds nothing resolves to null and a list read to [];
both are successful reads. Treating this as "not found" will hide an outage
behind an empty state.
Example
import { IndexerError } from "@somnia-chain/markets-sdk";
const markets = await exchange.client
.listBinaryMarkets()
.catch((e) => { if (e instanceof IndexerError) return []; throw e; });
Extends
Constructors
Constructor
new IndexerError(
operation,detail,options?):IndexerError
Defined in: packages/sdk/src/errors.ts:170
Parameters
operation
string
GraphQL operation name that failed (e.g. "listBinaryMarkets").
detail
string
Why it failed (HTTP status, GraphQL error message, "empty response").
options?
ErrorOptions
Standard cause passthrough — the underlying fetch/GraphQL failure.
Returns
IndexerError
Overrides
SomniaMarketsError.constructor
Properties
operation
readonlyoperation:string
Defined in: packages/sdk/src/errors.ts:171
GraphQL operation name that failed (e.g. "listBinaryMarkets").