From 38bc95b4fb4d2ef5874336db922b58cc2f6864ee Mon Sep 17 00:00:00 2001 From: Jairo Matos Da Rocha Date: Fri, 22 Nov 2024 16:03:53 -0300 Subject: [PATCH] error --- main.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index 9d06bd7..8e7ffaf 100644 --- a/main.py +++ b/main.py @@ -48,19 +48,17 @@ def gee_credentials(private_key_file): @app.exception_handler(StarletteHTTPException) async def http_exception_handler(request, exc): - start_code = exc.status_code - logger.info(exc) - + start_code = str(exc.status_code) if request.url.path.split('/')[1] == 'api': try: return JSONResponse( - content={'status_code': start_code, 'message': exc.detail}, + content={'status_code': start_code, 'message': str(exc.detail)}, status_code=start_code, headers=exc.headers, ) except: return JSONResponse( - content={'status_code': start_code, 'message': exc.detail}, + content={'status_code': start_code, 'message': str(exc.detail)}, status_code=start_code )