Errors¶
- class xanax.errors.XanaxError(message)[source]¶
Bases:
ExceptionBase exception for all xanax errors.
This is the parent class for all library-specific exceptions.
- class xanax.errors.AuthenticationError(message='Authentication failed. Check your API key.')[source]¶
Bases:
XanaxErrorRaised when authentication fails.
This includes: - 401 HTTP responses - Missing API key when accessing NSFW content - Invalid API key
- class xanax.errors.RateLimitError(message='Rate limit exceeded. Please wait before making more requests.', retry_after=None)[source]¶
Bases:
XanaxErrorRaised when API rate limit is exceeded.
The API allows 45 requests per minute. When exceeded, a 429 response is returned with retry information.
- class xanax.errors.NotFoundError(message='Resource not found.')[source]¶
Bases:
XanaxErrorRaised when a requested resource is not found.
This typically corresponds to a 404 HTTP response.
- class xanax.errors.ValidationError(message)[source]¶
Bases:
XanaxErrorRaised when request parameters are invalid.
This includes: - Using topRange without toplist sorting - Invalid resolution format - Invalid ratio format - Other parameter validation failures
- class xanax.errors.APIError(message, status_code)[source]¶
Bases:
XanaxErrorRaised for unexpected API errors.
This catches any other HTTP errors that don’t fit the specific categories above. Includes the HTTP status code for debugging.