Raised when Open-Meteo cannot be reached or returns no usable data.
Distinguishes a transient external-API failure (network outage, rate-limit exhaustion, both the archive and forecast endpoints returning errors) from a real data-validity problem. Subclasses ValueError so existing callers that catch ValueError keep working; consumers that want to react specifically to weather-API failures (e.g. spotforecast2.multitask.base.BaseTask with config.on_weather_failure="skip") catch this class instead.
Examples
from spotforecast2_safe.weather.client import WeatherFetchErrortry:raise WeatherFetchError("Archive and forecast endpoints both failed")except WeatherFetchError as exc:print(f"Caught WeatherFetchError: {exc}")# WeatherFetchError is a subclass of ValueErrorassertissubclass(WeatherFetchError, ValueError)print("issubclass(WeatherFetchError, ValueError):", True)
Caught WeatherFetchError: Archive and forecast endpoints both failed
issubclass(WeatherFetchError, ValueError): True