changeset 0131ce3e6648 in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset;node=0131ce3e6648
description:
Add debug logging when exception happens in dispatch request
issue9526
review310201002
diffstat:
trytond/wsgi.py | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diffs (25 lines):
diff -r 080a43fdf5d2 -r 0131ce3e6648 trytond/wsgi.py
--- a/trytond/wsgi.py Sat Sep 05 22:59:38 2020 +0200
+++ b/trytond/wsgi.py Sat Sep 05 23:40:29 2020 +0200
@@ -110,8 +110,12 @@
self.check_request_size(request, max_request_size)
return endpoint(request, **request.view_args)
except HTTPException as e:
+ logger.debug(
+ "Exception when processing %s", request, exc_info=True)
return e
except Exception as e:
+ logger.debug(
+ "Exception when processing %s", request, exc_info=True)
tb_s = ''.join(traceback.format_exception(*sys.exc_info()))
for path in sys.path:
tb_s = tb_s.replace(path, '')
@@ -139,7 +143,7 @@
break
else:
if isinstance(data, Exception):
- response = InternalServerError(data)
+ response = InternalServerError(original_exception=data)
else:
response = Response(data)
return response