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 )