From 33bc380594b46ebcbd6e041d1dab3822fdf4d5e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dni=20=E2=9A=A1?= Date: Wed, 16 Oct 2024 07:48:08 +0200 Subject: [PATCH] traces for value and assertion errors --- lnbits/exceptions.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lnbits/exceptions.py b/lnbits/exceptions.py index 1f5e63c21..48269b39a 100644 --- a/lnbits/exceptions.py +++ b/lnbits/exceptions.py @@ -70,6 +70,8 @@ def register_exception_handlers(app: FastAPI): @app.exception_handler(AssertionError) async def assert_error_handler(request: Request, exc: AssertionError): + etype, _, tb = sys.exc_info() + traceback.print_exception(etype, exc, tb) logger.warning(f"AssertionError: {exc!s}") return render_html_error(request, exc) or JSONResponse( status_code=HTTPStatus.BAD_REQUEST, @@ -78,6 +80,8 @@ def register_exception_handlers(app: FastAPI): @app.exception_handler(ValueError) async def value_error_handler(request: Request, exc: ValueError): + etype, _, tb = sys.exc_info() + traceback.print_exception(etype, exc, tb) logger.warning(f"ValueError: {exc!s}") return render_html_error(request, exc) or JSONResponse( status_code=HTTPStatus.BAD_REQUEST,