Where errors appear
BlockDB WSS errors can surface in two places:- Handshake / connection layer: the server may refuse the upgrade (HTTP error) or close the socket with a WebSocket close code.
- Protocol layer: the server acknowledges
subscribe/unsubscribewith a*_responsemessage. Failures are returned asstatus: "error"with a structurederrorobject.
Protocol errors (subscribe/unsubscribe)
If a request is invalid (bad parameters, auth scope, limits), you’ll receive a response message:Error object fields
Theerror object is a stable schema designed for both humans and machines.
Machine-readable error code.
Human-readable summary of what went wrong.
Optional diagnostic hint that points to the most common fix.
One of
info, warning, error, critical.Whether retrying the same operation can succeed (typically with backoff).
Optional structured metadata (e.g., invalid field list, limit values, allowed enums).
Optional documentation link relevant to this error.
WebSocket close codes
Some failures are communicated by closing the WebSocket (especially auth/policy and backpressure).- See: WSS Error Codes
- Typical handling:
- 1008 POLICY_VIOLATION: verify API key / scope, then reconnect.
- 1013 TRY_AGAIN_LATER: treat as backpressure; back off and reduce subscriptions/filters.
- 1011 INTERNAL_ERROR: retry with jitter; contact support if persistent.
Practical handling guidance
- If
status: "error"andretryable: false: fix the request (usuallychain_id,dataset_id, orparamsformatting). - If
status: "error"andretryable: true: retry with exponential backoff and jitter. - If the socket closes: use the close code to decide whether to refresh credentials, reduce load, or retry later.