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: RuntimeError

The API returned an error.

Parameters:
status

HTTP status code.

detail

Server-supplied message, or the raw body if it was not JSON.

class TeamOverbyeWeather.RegionTooLargeError(detail, hint='')[source]

Bases: WeatherAPIError

The 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=False was requested explicitly.

Parameters:
class TeamOverbyeWeather.ServerBusyError(detail)[source]

Bases: WeatherAPIError

The download queue was full and stayed full across every retry (HTTP 503).

Parameters:

detail (str)