Write traceback of unexpected Exception in wsgi.errors

This commit is contained in:
Cédric Krier
2026-06-18 16:24:23 +02:00
parent e525eeb1cd
commit a57ea670a8
+2 -1
View File
@@ -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