Skip to content

Commit 0e55198

Browse files
committed
fix: don't wrap HTTPExceptions in generic 400 error
Root cause: except Exception caught HTTPException(403, REPO_TOO_LARGE) and re-raised as HTTPException(400, str(e)) which produced '403: {...}' Now HTTPExceptions are re-raised as-is so frontend gets proper 403 with structured detail object.
1 parent 26cc438 commit 0e55198

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

backend/routes/repos.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ async def add_repository(
140140
"analysis": analysis.to_dict(),
141141
"message": "Repository added successfully. Ready for indexing."
142142
}
143+
except HTTPException:
144+
raise # Re-raise HTTPExceptions (like REPO_TOO_LARGE) as-is
143145
except Exception as e:
144146
logger.error("Failed to add repository", error=str(e), user_id=user_id)
145147
capture_exception(e)

0 commit comments

Comments
 (0)