From a57ea670a8bc587e20f4f639701d6cf6f8ecc68d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 18 Jun 2026 16:24:23 +0200 Subject: [PATCH] Write traceback of unexpected Exception in wsgi.errors --- trytond/trytond/wsgi.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/trytond/trytond/wsgi.py b/trytond/trytond/wsgi.py index ee62d8b842..b9ce216cf7 100644 --- a/trytond/trytond/wsgi.py +++ b/trytond/trytond/wsgi.py @@ -133,8 +133,9 @@ class TrytondWSGI(object): return exceptions.ServiceUnavailable(description=str(e)) except Exception as e: logger.exception("Exception when processing %s", request) + tb_s = ''.join(traceback.format_exception(*sys.exc_info())) + request.environ['wsgi.errors'].write(tb_s) if self.dev: - tb_s = ''.join(traceback.format_exception(*sys.exc_info())) for path in sys.path: tb_s = tb_s.replace(path, '') e.__format_traceback__ = tb_s