🐛 Raise ComwattAPIError for non-credential authent failures #46
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "authent-error-statuses"
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?
Problem
_post_authentraisesComwattAuthErrorfor any non-200 onPOST /v1/authent— including 5xx during a Comwatt outage — and for the HTTP-200-but-no-cwt_session-cookie anomaly. Consumers (e.g. the Home Assistant integration) mapComwattAuthErrorto invalid credentials, so an outage gets misreported as a bad password.Change
On
POST /v1/authent:ComwattAuthErrorComwattAuthErrorComwattAuthErrorComwattAPIErrorcwt_sessioncookieComwattAuthErrorComwattAPIError_api_error()(regular API calls) is intentionally untouched. Docstrings + README updated accordingly.Tests
test_authenticate_missing_cookienow expectsComwattAPIErrortest_authenticate_error_403(→ComwattAuthError,.status_code == 403)test_authenticate_server_error_is_not_auth_error(503 →ComwattAPIError)Prepares comwatt-client 0.3.4, needed by the Home Assistant integration to map
ComwattAuthError→ reauth flow safely.WIP: 🐛 Raise ComwattAPIError for non-credential authent failuresto 🐛 Raise ComwattAPIError for non-credential authent failures