Skip to content

Errors

Every exception extends STXException. Catch the class you care about with instanceof.

Exception Extends When
STXException Error Base for every error the SDK throws.
STXConfigException STXException The client is misconfigured: unknown region, missing key, bad PEM.
STXAPIException STXException The API answered with an error status. Base for the classes below.
STXValidationException STXAPIException 400: a parameter or body field was rejected, e.g. price is required.
STXAuthenticationException STXAPIException 401: the signature, key ID or timestamp was not accepted. A machine clock more than 30 seconds off also lands here.
STXForbiddenException STXAPIException 403: the key is read-only, or the account may not do this. When the server names the scopes that would satisfy the call (in the WWW-Authenticate challenge), requiredScopes lists them.
STXNotFoundException STXAPIException 404: the resource does not exist, or belongs to another account.
STXRejectedException STXAPIException 422: the exchange refused the request, e.g. insufficient funds or a closed market.
STXGeoLocationException STXRejectedException 422 from the exchange’s geo-fencing: this request’s IP address is not allowed to trade, or the geolocation packet sent with it was missing, invalid, expired or from another user. A subclass of STXRejectedException, so existing catch blocks still see it.
STXRateLimitException STXAPIException 429: too many requests. retryAfter is seconds, when sent.
STXServerException STXAPIException 5xx: the server failed. Retried by the default policy on GET and DELETE.
STXTransportException STXException The request never got an answer: connection, DNS, TLS or timeout.
STXChannelException STXException A channel join or channel message was refused by the server. reply holds the server’s response object, for example {reason: "unauthorized"}.
STXTimeoutException STXChannelException No reply, message or snapshot arrived on a channel in time. A subclass of STXChannelException.

Base for every error the SDK throws.

Property Type Description
body unknown
method string | undefined
path string | undefined
statusCode number | undefined

The client is misconfigured: unknown region, missing key, bad PEM.

The API answered with an error status. Base for the classes below.

400: a parameter or body field was rejected, e.g. price is required.

401: the signature, key ID or timestamp was not accepted. A machine clock more than 30 seconds off also lands here.

403: the key is read-only, or the account may not do this. When the server names the scopes that would satisfy the call (in the WWW-Authenticate challenge), requiredScopes lists them.

Property Type Description
requiredScopes readonly string[]

404: the resource does not exist, or belongs to another account.

422: the exchange refused the request, e.g. insufficient funds or a closed market.

422 from the exchange’s geo-fencing: this request’s IP address is not allowed to trade, or the geolocation packet sent with it was missing, invalid, expired or from another user. A subclass of STXRejectedException, so existing catch blocks still see it.

reason classifies it; ipAddress is the address the exchange saw, when its message names one. Never retried.

Property Type Description
ipAddress string | undefined
reason "ip_not_allowed" | "packet_invalid" | "packet_other_user" | "packet_ip_mismatch" | "location_not_allowed"

429: too many requests. retryAfter is seconds, when sent.

Property Type Description
retryAfter number | undefined

5xx: the server failed. Retried by the default policy on GET and DELETE.

The request never got an answer: connection, DNS, TLS or timeout.

A channel join or channel message was refused by the server. reply holds the server’s response object, for example {reason: "unauthorized"}.

Property Type Description
reply unknown
topic string

No reply, message or snapshot arrived on a channel in time. A subclass of STXChannelException.

v1.5.9Changelogllms.txtllms-full.txt