Viewing: Errors

Real-time WebSocket - Errors

Handle websocket failures with a unified error envelope. Treat close code as class and latest `error.code/details` as the action signal.

WS_AUTH_OR_ACCESS4401 / 4403MARKET_DATA_ENTITLEMENT_*

Account access or entitlement issue blocks streaming access.

Action: 4401 means fix API key auth, 4403 means fix account/plan entitlement state. Do not auto-reconnect.

WS_RATE_LIMIT4429DEPTH_WS_*_LIMIT / *_RATE_LIMITED

Connection, subscription, or action throttles were exceeded.

Action: Retry with backoff + jitter and honor `retry_after_seconds` from latest error details when present.

WS_INVALID_REQUESTINVALID_JSON / UNKNOWN_ACTION / SYMBOL_REQUIRED

Malformed payload or unsupported action.

Action: Fix payload and retry immediately.

Multi-connection guardrails

  • Open sockets with a 200-400ms stagger instead of starting all at once.
  • Queue reconnect attempts globally per API key.
  • Avoid synchronized reconnect storms around market open.

Error Envelope

json
{
  "type": "error",
  "code": "ERROR_CODE",
  "message": "Human-readable message",
  "details": {}
}