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