2.2 KiB
2.2 KiB
| id | type | title | tags | importance | confidence | created | updated | relations | |||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| a5f56cb6-9a7b-4224-98f3-aefc4cfc0a2a | fix | Fix: swallowed HTTPException in recalculate_standings — use sed to avoid linter reformatting |
|
0.7 | 0.8 | 2026-03-03T01:36:59.027516+00:00 | 2026-03-03T01:37:03.490572+00:00 |
|
Fix: Swallowed HTTPException in recalculate_standings
Problem
app/routers_v3/standings.py line 124 constructed an HTTPException but never raised it, causing the endpoint to always return 200 even on failure.
Root Cause
Missing raise keyword:
# Bug
HTTPException(status_code=500, detail=f'Error recreating Standings rows')
# Fix
raise HTTPException(status_code=500, detail=f'Error recreating Standings rows')
Solution
Add the single raise keyword. Used sed -i directly rather than the Edit tool, because the Edit tool triggers a linter (black/ruff) that reformats the entire file — which caused the previous PR (#40) to be rejected.
sed -i "s/ HTTPException(status_code=500, detail=f'Error recreating Standings rows')/ raise HTTPException(status_code=500, detail=f'Error recreating Standings rows')/" app/routers_v3/standings.py
Key Lesson
When a repo has an auto-formatter configured as a save hook, use sed or Bash tool for surgical one-line fixes instead of the Edit tool, to avoid unintended reformatting of the whole file.
Files Changed
app/routers_v3/standings.py(1 line, 1 word added)
PR
- Issue: major-domo-database#23
- PR: major-domo-database#41