Fix silent exception swallowing in route handlers #11
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Multiple route handlers catch broad exceptions and return empty responses, making outages invisible:
When the database is down or a query fails, the client receives
{}with HTTP 200. No error is logged. Monitoring cannot detect the failure.Required Actions
except Exceptionacross allcompliance/api/files — audit each occurrencelogger.exception("...", exc_info=True)before handlingHTTPException(status_code=500)with a generic client message (never rawstr(e))return {}withraise HTTPException(500, detail="Internal error")main.pyas a final safety netAcceptance Criteria
grep -r "except Exception:" compliance/api/— every match has alogger.exceptioncall before it