MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / handle_exception

Method handle_exception

fastdeploy/utils.py:180–182  ·  view source on GitHub ↗
(request: Request, exc: Exception)

Source from the content-addressed store, hash-verified

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

Callers 1

test_handle_exceptionMethod · 0.80

Calls 3

ErrorResponseClass · 0.90
ErrorInfoClass · 0.90
model_dumpMethod · 0.45

Tested by 1

test_handle_exceptionMethod · 0.64