claude-memory/graph/fixes/fix-swallowed-httpexception-in-recalculate-standings-use-sed-a5f56c.md
2026-03-02 19:37:03 -06:00

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
major-domo-database
fastapi
python
httpexception
linter
sed
standings
0.7 0.8 2026-03-03T01:36:59.027516+00:00 2026-03-03T01:37:03.490572+00:00
target type direction strength edge_id
a64fd0a1-cf42-469a-9280-991ab85bbfb2 RELATED_TO outgoing 0.61 395d03bb-07fc-4c9c-afa1-b020ef6883c2
target type direction strength edge_id
2a71ad5b-ba11-4fa8-8088-a1a67df8106b RELATED_TO outgoing 0.58 7fd88df7-3e25-44cf-85a8-a2399f5bfab3
target type direction strength edge_id
16053713-9854-4411-80e6-0cd23e70be8d RELATED_TO outgoing 0.57 ebc9c602-b1d2-48fc-9fd6-1f7106b10f2c
target type direction strength edge_id
57e38d6f-828e-496b-af23-da7f4806252c FOLLOWS outgoing 0.8 d7fea2ee-b026-4b54-831e-df1cc16f0549

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