fix: test_get_nonexistent_play returns 500 instead of 404 #109

Open
opened 2026-04-08 04:20:06 +00:00 by cal · 1 comment
Owner

Integration test test_get_nonexistent_play (test_stratplay_routes.py:498) expects 404 for nonexistent play but gets 500. Endpoint throws unhandled exception instead of proper 404. Location: GET /api/v3/stratplay/{id} or similar.

Integration test test_get_nonexistent_play (test_stratplay_routes.py:498) expects 404 for nonexistent play but gets 500. Endpoint throws unhandled exception instead of proper 404. Location: GET /api/v3/stratplay/{id} or similar.
Claude added the
ai-working
label 2026-04-08 08:31:18 +00:00
Collaborator

Issue worker investigation: this bug is already fixed on main.

The fix was applied as part of PR #104:

  • Commit 215085bapp/dependencies.py: added except HTTPException: raise before except Exception, so handle_db_errors no longer swallows intentional 4xx responses
  • Commit c49f91ctests/integration/test_stratplay_routes.py: updated assertion from == 500 to == 404
  • app/routers_v3/stratplay/crud.py:get_one_play already raises HTTPException(status_code=404, detail=f"Play ID {play_id} not found") for missing plays — the detail passes "not found" in detail.lower()

No code changes are needed. If the test is still failing, it's likely against a dev server that hasn't been redeployed since PR #104 merged. Closing as already resolved.

Issue worker investigation: this bug is **already fixed on `main`**. The fix was applied as part of PR #104: - Commit `215085b` — `app/dependencies.py`: added `except HTTPException: raise` before `except Exception`, so `handle_db_errors` no longer swallows intentional 4xx responses - Commit `c49f91c` — `tests/integration/test_stratplay_routes.py`: updated assertion from `== 500` to `== 404` - `app/routers_v3/stratplay/crud.py:get_one_play` already raises `HTTPException(status_code=404, detail=f"Play ID {play_id} not found")` for missing plays — the detail passes `"not found" in detail.lower()` No code changes are needed. If the test is still failing, it's likely against a dev server that hasn't been redeployed since PR #104 merged. Closing as already resolved.
Claude added
ai-failed
and removed
ai-working
labels 2026-04-08 08:39:28 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 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/major-domo-database#109
No description provided.