Exceptions
from TeamOverbyeWeather import (
WeatherAPIError,
RegionTooLargeError,
ServerBusyError,
)
All three inherit from WeatherAPIError, so a single
except WeatherAPIError catches every API failure.
from TeamOverbyeWeather import WeatherAPIError
try:
client.download("era5", dates="1999-Q1", dest="./data")
except WeatherAPIError as exc:
print(exc.status, exc.detail) # 404 No file ID for era5_na 1999-Q1
Argument mistakes — an unknown source, a malformed date, an inverted bounding
box — raise plain ValueError before any request is made.
- class TeamOverbyeWeather.WeatherAPIError(status, detail)[source]
Bases:
RuntimeErrorThe API returned an error.
- status
HTTP status code.
- detail
Server-supplied message, or the raw body if it was not JSON.
- class TeamOverbyeWeather.RegionTooLargeError(detail, hint='')[source]
Bases:
WeatherAPIErrorThe server refused to crop a CONUS-scale request (HTTP 413).
The SDK normally handles this by falling back to a local crop; this is only raised when
local_crop=Falsewas requested explicitly.
- class TeamOverbyeWeather.ServerBusyError(detail)[source]
Bases:
WeatherAPIErrorThe download queue was full and stayed full across every retry (HTTP 503).
- Parameters:
detail (str)