Add aiohttp.ClientError handling to all API call functions #29

Closed
opened 2026-02-20 06:51:49 +00:00 by cal · 1 comment
Owner

api_calls.py catches asyncio.TimeoutError but not aiohttp.ClientConnectionError or aiohttp.ClientResponseError. DNS failure or refused connection raises unformatted error to Discord user.

`api_calls.py` catches `asyncio.TimeoutError` but not `aiohttp.ClientConnectionError` or `aiohttp.ClientResponseError`. DNS failure or refused connection raises unformatted error to Discord user.
cal added the
bug
label 2026-02-20 06:51:49 +00:00
cal added the
ai-working
label 2026-03-05 10:01:07 +00:00
cal removed the
ai-working
label 2026-03-05 10:03:34 +00:00
Author
Owner

PR opened: #57

Added except aiohttp.ClientError as e handlers to all five API functions (db_get, db_patch, db_post, db_put, db_delete). Each handler logs the error and raises DatabaseError so callers get a consistent, formatted exception instead of a raw aiohttp error bubbling up to Discord users.

PR opened: https://git.manticorum.com/cal/paper-dynasty-discord/pulls/57 Added `except aiohttp.ClientError as e` handlers to all five API functions (`db_get`, `db_patch`, `db_post`, `db_put`, `db_delete`). Each handler logs the error and raises `DatabaseError` so callers get a consistent, formatted exception instead of a raw aiohttp error bubbling up to Discord users.
cal added the
ai-pr-opened
label 2026-03-05 10:03:43 +00:00
cal closed this issue 2026-03-10 18:26:30 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cal/paper-dynasty-discord#29
No description provided.