Thermograph monorepo: graded-climate API + SSR frontend + infra, domain-specific containerized deploys
Find a file
Emi Griffith 7c5b5137f1 Classify weather-fetch failures with a typed exception (#44)
Rate-limit handling crossed the climate→app boundary as prose: climate
raised RuntimeError(cooldown text), and app._weather_fetch_error re-parsed
it by keyword ('429'/'rate-limited'/'daily'/'tomorrow') while also calling
climate's private _is_rate_limit/_rate_limit_reason — and the user-facing
daily-quota copy existed verbatim in both modules.

climate now raises WeatherUnavailable (a RuntimeError subclass carrying
the user-facing text and a daily flag): from _load_history when both
sources fail with no stale cache, and from the forecast fetch on a 429.
limit_message() is the single home of the rate-limit copy; is_rate_limit
is public for the one remaining raw-429 fallback. app maps the typed
error to 503 by isinstance — no message parsing, no private imports.

The burst-limit copy is unified on 'The weather service is rate-limited…'
(the archive path previously said 'weather archive' internally but the
API always rewrote it; user-visible text is unchanged).

Tests: daily-quota 503 carries the 'tomorrow' copy, an unclassified raw
429 still maps to a clean 503, and a genuine fault stays a 502 with the
raw error.
2026-07-11 19:53:46 +00:00
tests Classify weather-fetch failures with a typed exception (#44) 2026-07-11 19:53:46 +00:00
app.py Classify weather-fetch failures with a typed exception (#44) 2026-07-11 19:53:46 +00:00
audit.py Initial commit: app + 2026-07-10 17:29:47 -07:00
climate.py Classify weather-fetch failures with a typed exception (#44) 2026-07-11 19:53:46 +00:00
grading.py Initial commit: app + 2026-07-10 17:29:47 -07:00
grid.py Worldwide coverage: grade any point on Earth (#32) 2026-07-11 15:02:28 +00:00
migrate.py Single-source cache identity; shared fetch preamble and cache flow (#43) 2026-07-11 19:49:15 +00:00
places.py Typo-tolerant location search suggestions (#33) 2026-07-11 15:36:14 +00:00
requirements-dev.txt Add backend test suite; gate direct pushes; serialize LAN deploys (#41) 2026-07-11 19:37:49 +00:00
requirements.txt Initial commit: app + 2026-07-10 17:29:47 -07:00
store.py Fix compare place names (Nominatim burst) + weekly duplicate location name (#29) 2026-07-11 09:03:57 +00:00
views.py Single-source cache identity; shared fetch preamble and cache flow (#43) 2026-07-11 19:49:15 +00:00