Every error thrown by the SDK extends StructError, so you can use instanceof checks to branch on failure mode without inspecting error messages.
Hierarchy
REST
HttpError
body is the parsed JSON response when the server returned JSON. Otherwise it is the raw response text.
Retry integration
When retry is configured on the client, HttpError responses with retryable status codes (429, 500, 502, 503, 504), NetworkError, and TimeoutError are retried automatically before the error reaches your code. Retry-After headers are honoured. See Configuration.
WebSocket
WebSocket errors are surfaced through the error event on the socket. For operations that return promises (connect, subscribe), rejected promises carry WebSocketError or WebSocketClosedError.
Listener errors
If an event listener throws, the SDK forwards the error to any error listeners and logs it to the console as a fallback. Listener exceptions never crash the socket. Last modified on April 14, 2026