Errors¶
stormlore.errors ¶
Every error the SDK raises.
All of them derive from :class:StormloreError. Errors the API answered with are
:class:APIError subclasses chosen by the API's machine-readable error code, and
carry code, message, http_status, request_id and attempts (how many
requests were sent, retries included).
StormloreError ¶
Bases: Exception
Base class of every error the SDK raises.
MissingApiKeyError ¶
Bases: StormloreError
No API key was given and WXCHANGE_API_KEY is unset or blank.
MissingExtraError ¶
UnknownZipError ¶
Bases: StormloreError, ValueError
A ZIP code given as a place has no ZIP Code Tabulation Area on the API.
ZipLookupForbiddenError ¶
UnitConversionError ¶
Bases: StormloreError, ValueError
A value cannot be converted to the requested units.
ConnectionError ¶
Bases: StormloreError
The API could not be reached, or the response did not arrive in time.
timed_out is true when the request was sent but the response took longer than
the client's timeout; such a request is never replayed.
APIError ¶
Bases: StormloreError
The API answered with an error.
Attributes:
| Name | Type | Description |
|---|---|---|
code |
The API's machine-readable |
|
message |
The API's human-readable message. |
|
http_status |
The HTTP status code. |
|
request_id |
The |
|
attempts |
How many requests were sent, retries included. |
|
body |
The parsed JSON body, when there was one. |
InvalidRequestError ¶
SubscribeRequiredError ¶
Bases: ForbiddenError
The model (or source) is listed in the catalog but this account has not subscribed.
model_id (or source) names it, for a subscribe link.
ModelNotFoundError ¶
ParameterNotFoundError ¶
RunNotFoundError ¶
StepNotFoundError ¶
ObservationNotFoundError ¶
ObservationSourceNotFoundError ¶
AdvisoryNotFoundError ¶
ZipsTooManyError ¶
Bases: InvalidRequestError
Too many ZIP codes for one answer (413 zips_too_many); count says how many.
ZipsTooLargeError ¶
Bases: InvalidRequestError
The ZIP shapes asked for exceed what one answer may carry (413 zips_too_large).
DatetimeInGapError ¶
Bases: APIError
The time falls in a gap between an analysis model's frames (422).
body carries before, after, gap_s and max_gap_s.
RateLimitError ¶
KeyCapExceededError ¶
Bases: RateLimitError
The API key has spent the monthly call cap its organization set (429 key_cap_exceeded).
Never retried: it lifts when the cap is raised or the UTC month turns. cap is the
X-Sentinel-Cap header, "<used>/<limit>", when the API sent it.
ServiceUnavailableError ¶
LoadingError ¶
OverloadedError ¶
Bases: ServiceUnavailableError
The request was shed, not run (503 overloaded). Retried automatically.
UpstreamUnavailableError ¶
Bases: ServiceUnavailableError
A dependency of the API is down (503 upstream_unavailable); service names it.