(request: Request, exc: HTTPException)
| 7 | # Centralized error handlers for FastAPI |
| 8 | |
| 9 | def http_exception_handler(request: Request, exc: HTTPException): |
| 10 | return JSONResponse( |
| 11 | status_code=exc.status_code, |
| 12 | content={"detail": exc.detail} |
| 13 | ) |
| 14 | |
| 15 | def sqlalchemy_exception_handler(request: Request, exc: SQLAlchemyError): |
| 16 | logging.error(f"SQLAlchemy error: {exc}") |
nothing calls this directly
no outgoing calls
no test coverage detected