"""Exception types raised by the TeamOverbyeWeather client."""
from __future__ import annotations
[docs]
class WeatherAPIError(RuntimeError):
"""The API returned an error.
Attributes:
status: HTTP status code.
detail: Server-supplied message, or the raw body if it was not JSON.
"""
def __init__(self, status: int, detail: str) -> None:
super().__init__(f"[HTTP {status}] {detail}")
self.status = status
self.detail = detail
[docs]
class ServerBusyError(WeatherAPIError):
"""The download queue was full and stayed full across every retry (HTTP 503)."""
def __init__(self, detail: str) -> None:
super().__init__(503, detail)