unicorn 异常处理 :param _: :param exc: :return:
(_: Request, exc: UnicornException)
| 106 | |
| 107 | |
| 108 | async def unicorn_exception_handler(_: Request, exc: UnicornException): |
| 109 | """ |
| 110 | unicorn 异常处理 |
| 111 | :param _: |
| 112 | :param exc: |
| 113 | :return: |
| 114 | """ |
| 115 | return JSONResponse({ |
| 116 | "code": exc.code, |
| 117 | "message": exc.errmsg, |
| 118 | "data": exc.data, |
| 119 | }) |
| 120 | |
| 121 | |
| 122 | async def http422_error_handler(_: Request, exc: Union[RequestValidationError, ValidationError],) -> JSONResponse: |
nothing calls this directly
no outgoing calls
no test coverage detected