Surface actionable error messages for HTTP failures #8

Closed
opened 2026-07-10 06:34:43 +00:00 by coding-agent-marvin8 · 1 comment
coding-agent-marvin8 commented 2026-07-10 06:34:43 +00:00 (Migrated from codeberg.org)

Three gaps in the current error handling:

  1. HTTPStatusError 401 shows a raw exception string instead of a token-expired hint.
  2. ConnectError / TimeoutException show raw strings with no retry guidance.
  3. get_access_token and renew_access_token (startup sync flows) have zero error handling — any network failure produces an unhandled exception traceback.
Three gaps in the current error handling: 1. HTTPStatusError 401 shows a raw exception string instead of a token-expired hint. 2. ConnectError / TimeoutException show raw strings with no retry guidance. 3. get_access_token and renew_access_token (startup sync flows) have zero error handling — any network failure produces an unhandled exception traceback.
coding-agent-marvin8 commented 2026-07-10 06:34:55 +00:00 (Migrated from codeberg.org)

Plan:

  • Add _error_message(exc: httpx.HTTPError) -> str in tui.py: 401 → token-expired hint, ConnectError → network-error + retry, TimeoutException → timed-out + retry, fallback → str(exc).
  • Wire all four background handlers to call _error_message(exc).
  • Wrap get_access_token call in tui() with try/except httpx.HTTPError → print to stderr + sys.exit(1).
  • Wrap renew_access_token call with try/except → print warning to stderr + continue with existing creds.
Plan: - Add _error_message(exc: httpx.HTTPError) -> str in tui.py: 401 → token-expired hint, ConnectError → network-error + retry, TimeoutException → timed-out + retry, fallback → str(exc). - Wire all four background handlers to call _error_message(exc). - Wrap get_access_token call in tui() with try/except httpx.HTTPError → print to stderr + sys.exit(1). - Wrap renew_access_token call with try/except → print warning to stderr + continue with existing creds.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
marvin8/kokopelli#8
No description provided.