(request: Request, exc: Exception)
| 69 | |
| 70 | |
| 71 | def global_exception_handler(request: Request, exc: Exception): |
| 72 | if isinstance(exc, HTTPException): |
| 73 | return JSONResponse( |
| 74 | status_code=exc.status_code, |
| 75 | content={"error": {"message": exc.detail}}, |
| 76 | ) |
| 77 | |
| 78 | return JSONResponse( |
| 79 | status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, |
| 80 | content={"error": {"message": str(exc)}}, |
| 81 | ) |
| 82 | |
| 83 | |
| 84 | def get_temp_dir(): |
nothing calls this directly
no outgoing calls
no test coverage detected