The SDK exposes two error classes:Documentation Index
Fetch the complete documentation index at: https://docs.ostium.com/llms.txt
Use this file to discover all available pages before exploring further.
OstiumErrorfor client creation, transaction building, signing, submission, and contract interactionOstiumSubgraphErrorfor subgraph reads, builder API reads, parsing, and stream-related data lookups
OstiumError
OstiumError is thrown by the main OstiumClient surface.
Error codes
| Code | Meaning |
|---|---|
INVALID_CONFIG | The client was created with incompatible or missing configuration for the selected mode. |
VALIDATION_FAILED | Input parameters failed SDK validation before submission. |
ALLOWANCE_INSUFFICIENT | The trader does not have enough USDC allowance for the requested action. |
SUBMISSION_FAILED | Transaction or user operation submission failed. |
DELEGATION_FAILED | Delegation setup is missing or the requested delegated action is not allowed in the current mode. |
CONTRACT_ERROR | A contract read or write failed. |
NETWORK_ERROR | An RPC or network request failed. |
OstiumSubgraphError
OstiumSubgraphError is thrown by read methods backed by the subgraph or builder API.
Error codes
| Code | Meaning |
|---|---|
INVALID_CONFIG | The read client was created with invalid endpoint or mode configuration. |
INVALID_PARAMS | The read method was called with invalid arguments. |
FETCH_FAILED | The subgraph or builder API request failed. |
NOT_FOUND | A requested entity or pair could not be found. |
PARSE_ERROR | The SDK received data but could not parse it into the expected shape. |
Recommended handling
- Catch
OstiumErroraround trade setup and write methods. - Catch
OstiumSubgraphErroraround read methods and streams. - Log both
error.codeanderror.message. - If present, inspect
error.causefor the underlying RPC, contract, or fetch error.