♻️ refactor: single _error_class mapping for status→exception #200
Loading…
Reference in a new issue
No description provided.
Delete branch "refactor/error-class-helper"
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?
Summary
The status→exception mapping, previously encoded twice with different rules, collapses into one helper (#187):
Future error sites (e.g. the WS handshake path) branch on the helper instead of guessing.
Evidence
_api_errormapped 401-only,_post_authentmapped (401, 403) inline — the asymmetry undocumented and duplicative.After: behavior pinned by tests — existing
test_authenticate_error_403(login 403 → AuthError) plus a new pintest_resource_403_raises_api_error_not_auth_error(resource 403 → APIError, previously uncovered).pytest -q→ 243 passed,mypy→ clean.Merge Danger
Door: two-way
Blast Radius: none — pure refactor, no behavior change;
_post_authentstill accepts only 200 on login (unchanged by #180 on purpose).Closes #187.
WIP: ♻️ refactor: single _error_class mapping for status→exceptionto ♻️ refactor: single _error_class mapping for status→exception