Skip to content

Exceptions

Every exception the SDK raises derives from SweatStackError. See Errors for which ones to handle.

Typed exception hierarchy for the SweatStack client.

This module defines all exceptions raised by the SweatStack library. No httpx types are exposed — this is the public error contract.

SweatStackAPIError

Bases: SweatStackError

HTTP response with an error status code.

SweatStackAuthError

Bases: SweatStackAPIError

401 or 403: authentication or authorization failure.

SweatStackBadRequestError

Bases: SweatStackAPIError

4xx (not 401, 403, 404, 429): client sent invalid input.

SweatStackConnectionError

Bases: SweatStackError

Transport-level failure: DNS, connect timeout, read timeout, no response.

SweatStackError

Bases: Exception

Base exception for all SweatStack errors.

SweatStackNotFoundError

Bases: SweatStackAPIError

404: resource not found.

SweatStackRateLimitError

Bases: SweatStackAPIError

429: rate limited.

SweatStackServerError

Bases: SweatStackAPIError

5xx: server-side failure, transient, safe to retry for idempotent ops.

SweatStackTokenRefreshError

Bases: SweatStackError

Token refresh failed (expired, missing, or refresh request failed).