Return a generic error response without exposing internal details.
(
operation: str, status_code: int = status.HTTP_400_BAD_REQUEST
)
| 16 | |
| 17 | |
| 18 | def _safe_error_response( |
| 19 | operation: str, status_code: int = status.HTTP_400_BAD_REQUEST |
| 20 | ) -> Response: |
| 21 | """Return a generic error response without exposing internal details.""" |
| 22 | return Response( |
| 23 | content=json.dumps( |
| 24 | {"detail": f"{operation} failed. Check server logs for details."} |
| 25 | ), |
| 26 | status_code=status_code, |
| 27 | media_type="application/json", |
| 28 | ) |
| 29 | |
| 30 | |
| 31 | def _build_projects_list( |
no outgoing calls
no test coverage detected