(request: Request, exc: Exception)
| 178 | # 全局异常兜底处理 |
| 179 | @staticmethod |
| 180 | async def handle_exception(request: Request, exc: Exception) -> JSONResponse: |
| 181 | error = ErrorResponse(error=ErrorInfo(message=str(exc), type=ErrorType.INTERNAL_ERROR)) |
| 182 | return JSONResponse(content=error.model_dump(), status_code=HTTPStatus.INTERNAL_SERVER_ERROR) |
| 183 | |
| 184 | # 处理请求参数验证异常 |
| 185 | @staticmethod |