Errors

This page documents all error conditions for the WebSocket API, including close codes, connection failures, and application-level error messages.

WebSocket Close Codes

The server uses standard and application-specific WebSocket close codes:

CodeNameTriggerClient Action
1000Normal ClosureConnection closed gracefully by serverNo action needed
1001Going AwayServer is shutting down (graceful shutdown)Reconnect after a delay with backoff
4001Slow ConsumerClient's send buffer is full (can't keep up with message rate)Reconnect and resubscribe for a fresh snapshot

Connection-Level Failures

These failures result in a silent close with no WebSocket close frame sent:

FailureTriggerTimeoutClient Observation
Read TimeoutNo message received within 60s60sConnection drops; send pings every <30s to prevent
Read ErrorUnderlying TCP/TLS error during read--Connection drops unexpectedly
Write ErrorTCP/TLS write failure in write loop--Connection drops unexpectedly
Upgrade RejectedServer shutting down during HTTP upgrade--HTTP 503 Service Unavailable

To avoid read timeouts, send a {"operation": "ping"} heartbeat at least every 30 seconds.

Protocol Errors

Errors returned by REST-over-WebSocket operations as JSON messages with type set to "error":

json
{"type": "error", "errorName": "...", "message": "...", "id": 1}

The id field echoes the request ID when available, allowing clients to correlate errors with specific requests.

errorNameTriggerExample Message
invalid_requestUnparseable JSON or missing operation field"invalid JSON request", "missing operation field"
unknown_operationoperation doesn't match any OpenAPI operationId"unknown operation: invalidOp"
invalid_parametersMissing/invalid path or query parameters"missing required path parameter: symbol"
too_many_requestsPer-connection concurrent request limit exceeded (default 100)"too many concurrent requests, try again later"
internal_errorUnhandled server-side error during dispatch"internal error"

Subscription Errors

Errors from subscribe / unsubscribe requests. The envelope is flat - there is no channel field on a subscription error:

json
{"type": "error", "errorName": "unknown_channel", "message": "..."}
errorNameTrigger
unknown_channelThe channel is not a recognized channel name (orderbook, ohlcv, trades, order).
subscription_failedThe channel is valid but params were rejected (missing field, unknown symbol, bad timeframe, malformed orderId).
unsubscribe_failedAn unsubscribe request could not be processed.
not_subscribedAn unsubscribe targeted a channel/params combination the connection was not subscribed to.