Skip to content

Error Codes ​

One error model spans the SDK: the Rust core classifies every failure once, and each language surfaces the classification in its idiom. Catch the specific class you can recover from; let the rest propagate.

Download as CSV

ConditionRust Error variantPython exceptionC++ exception
Bad or expired credentialsAuthAuthenticationError / InvalidCredentialsErrorthetadatadx::AuthenticationError / thetadatadx::InvalidCredentialsError
Endpoint needs a higher tierGrpc (permission)SubscriptionErrorthetadatadx::SubscriptionError
Too many requests in flight upstreamGrpc (resource exhausted)RateLimitErrorthetadatadx::RateLimitError
Upstream service unavailableGrpc (unavailable)UnavailableErrorthetadatadx::UnavailableError
Request returned no rowsGrpc (not found)NotFoundError / NoDataFoundErrorthetadatadx::NotFoundError
Per-request deadline elapsedTimeoutDeadlineExceededError / TimeoutErrorthetadatadx::DeadlineExceededError
Connection / TLS / protocol faultTransportNetworkErrorthetadatadx::NetworkError
Response shape unexpectedDecodeSchemaMismatchErrorthetadatadx::SchemaMismatchError
Streaming session faultStreamStreamErrorthetadatadx::StreamError
Invalid parameter or configuration valueConfig (invalid value)InvalidParameterErrorthetadatadx::InvalidParameterError
Configuration file or environment faultConfig (other)ConfigErrorthetadatadx::ConfigError
  • Python exceptions all derive from ThetaDataError, so except ThetaDataError is the catch-all.
  • TypeScript throws a typed subclass, the same hierarchy the other bindings expose: catch (e) { if (e instanceof SubscriptionError) ... }. A rate-limit error carries retryAfter. The message still carries the same stable text as the Rust Display output, but an instance check is the reliable test, not a pattern over the message.
  • C++ exceptions derive from thetadatadx::ThetaDataError, so catch (const thetadatadx::ThetaDataError&) is the catch-all.
python
from thetadatadx import NoDataFoundError, RateLimitError, ThetaDataError

try:
    rows = client.market_data.option_history_trade("SPY", "20250321", "20250303", strike="570", right="C")
except NoDataFoundError:
    rows = []                # nothing traded: a normal outcome, not a failure
except RateLimitError:
    ...                      # back off and retry; see Concurrent Requests
except ThetaDataError:
    raise                    # anything else is a real failure

Transient faults (transport drops, upstream exhaustion) are retried inside the SDK with backoff before any error surfaces; tune the budget via the retry_* configuration fields.

Server errors ​

The HTTP server answers every failed request the way the terminal does: with an HTTP status and the reason as a plain-text (text/plain) body.

HTTP statusMeaning
400Missing or invalid parameter, or more than 32 query parameters; the body names it.
404Unknown endpoint; the body names it. A path the server does not serve at all gets an empty 404.
410A v2 query parameter; the body names its v3 replacement.
503Upstream capacity exhausted after retries; carries Retry-After.
Set by the upstreamThe upstream service rejected the request. The server answers with the HTTP status the service attaches to the rejection (for example its no-data status when a query matches no rows) and the service's description, or with 500 when the service attaches no status.

Released under the Apache-2.0 License.