[client] WeatherProxy.forecast docstring claims ComwattAuthError is never raised — a proxy 401 maps to it #183
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The
WeatherProxy.forecastdocstring (_weather.py:59-60) says:That claim is wrong:
_requestfunnels every non-200 into_api_error(_core.py:46-47), where any 401 maps toComwattAuthError. A 401 from the proxy (upstream OpenWeatherMap auth issue, misconfigured gateway route) would surface asComwattAuthError— misleading for an unauthenticated call.Two options:
ComwattAuthErrorvia the shared error mapping;ComwattAPIErrorthere: semantically cleaner but adds URL-based branching to_api_error— probably not worth it.Recommend the docstring fix.
Done when: docstring matches actual behavior, and a test pins it (mock 401 →
pytest.raises(ComwattAuthError)).