From 0538f2cacd53fb3abdb3ae19b93683a0aac40382 Mon Sep 17 00:00:00 2001 From: wuaho Date: Thu, 3 Jun 2021 09:31:14 +0800 Subject: [PATCH] update --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index e05ad26..e7bc70c 100644 --- a/main.py +++ b/main.py @@ -23,12 +23,12 @@ app.add_middleware( @app.exception_handler(RequestValidationError) async def validation_exception_handler(request, exc): - return Response(schemas.Msg(code=-1, msg='服务器错误', data=str(exc)).json(), status_code=200) + return Response(schemas.Msg(code=-1, msg='请求错误', data=str(exc)).json(), status_code=400) @app.exception_handler(Exception) async def http_exception_handler(request, exc): - return Response(schemas.Msg(code=-1, msg='服务器错误', data=str(exc)).json(), status_code=200) + return Response(schemas.Msg(code=-1, msg='服务器错误', data=str(exc)).json(), status_code=500) if __name__ == '__main__':