Exceptions

All exceptions raised by liquipydia inherit from LiquipediaError. Catch the base class to handle every library failure with a single except, or catch specific subclasses when you want to react differently per failure mode.

Hierarchy

LiquipediaError              # base — catch this for any library error
├── AuthError                # HTTP 403: invalid or missing API key
├── NotFoundError            # HTTP 404: requested data does not exist
├── RateLimitError           # HTTP 429: retries exhausted (carries retry_after)
├── ApiError                 # API responded 2xx but the body contains an error array
└── NetworkError             # no response: timeout (retries exhausted), connection or protocol error

NetworkError wraps the underlying HTTP client exception, which stays available as __cause__, so no httpx2 exception escapes the client. Other failures (non-2xx responses without a dedicated subclass, malformed JSON, unexpected response shapes) are raised as the bare LiquipediaError.

Reference

exception liquipydia.LiquipediaError

Bases: Exception

Base exception for all liquipydia errors.

__init__(message)
exception liquipydia.AuthError

Bases: LiquipediaError

Raised when the API key is invalid or missing (HTTP 403).

exception liquipydia.NotFoundError

Bases: LiquipediaError

Raised when the requested data does not exist (HTTP 404).

exception liquipydia.RateLimitError

Bases: LiquipediaError

Raised when the API rate limit is exceeded (HTTP 429).

retry_after

Suggested wait time in seconds before retrying, or None if unknown.

__init__(message, *, retry_after=None)
exception liquipydia.ApiError

Bases: LiquipediaError

Raised when the API returns an error in the response body.

exception liquipydia.NetworkError

Bases: LiquipediaError

Raised when a request fails before any response is received.

Wraps the underlying HTTP client error (timeout, connection or protocol error), which stays available as __cause__. Timeouts are retried like HTTP 429 responses before this is raised.