TrussetError and carry a machine-readable code, HTTP statusCode, and the server’s requestId when available. Catch specific subclasses to handle different failure modes.
Error hierarchy
Catching errors
Error properties
EveryTrussetError instance exposes:
| Property | Type | Description |
|---|---|---|
message | string | Human-readable error description |
code | string | Machine-readable error code (e.g. NOT_FOUND, RELAYER_FROZEN) |
statusCode | number | HTTP status code. 0 for network errors. |
requestId | string | null | Server-assigned request ID for support inquiries |
Common error codes
| Code | Status | Meaning |
|---|---|---|
AUTH_REQUIRED | 401 | No API key provided |
AUTH_FAILED | 401 | Invalid or expired API key |
NOT_FOUND | 404 | Resource does not exist |
CUSTOMER_EXISTS | 409 | Duplicate wallet or externalId |
WALLET_IN_USE | 409 | Wallet already assigned to another customer |
SERVICE_NOT_ENABLED | 403 | Required service not enabled on this instance |
RELAYER_NOT_CONFIGURED | 400 | No relayer wallet set up for this instance |
RELAYER_FROZEN | 403 | Relayer is frozen - unfreeze in the Issuer Platform |
RELAYER_LIMIT_EXCEEDED | 429 | Daily transaction limit reached |
VALIDATION_ERROR | 400 | Client-side input validation failure |
Retry behavior
The HTTP layer automatically retries requests that fail with transient errors:| Status | Retried |
|---|---|
| 408 Request Timeout | Yes |
| 429 Too Many Requests | Yes |
| 500 Internal Server Error | Yes |
| 502 Bad Gateway | Yes |
| 503 Service Unavailable | Yes |
| 504 Gateway Timeout | Yes |
| Network errors (DNS, connection) | Yes |
| Timeouts (AbortError) | Yes |
| 400, 401, 403, 404, 409 | No |
maxRetries in the client constructor. Set to 0 to disable.
Logging
Pass a logger to surface retry attempts and request metadata during development:debug calls for retry attempts, including the URL and attempt number. No sensitive data (API keys, request bodies) is logged.