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

Other transport-level 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.