# HG changeset patch # User Marcin Kuzminski # Date 2016-12-22 23:14:05 # Node ID e94213638aee451acbf9d6b6a60318d9ca0d059a # Parent 0dbc30fab94ffb7a40e4838eb0554d0e2e9f0f8b http-mode: expose tracebacks back to the client. diff --git a/vcsserver/http_main.py b/vcsserver/http_main.py --- a/vcsserver/http_main.py +++ b/vcsserver/http_main.py @@ -20,6 +20,7 @@ import locale import logging import uuid import wsgiref.util +import traceback from itertools import chain import msgpack @@ -227,6 +228,8 @@ class HTTPApplication(object): try: resp = getattr(remote, method)(*args, **kwargs) except Exception as e: + tb_info = traceback.format_exc() + type_ = e.__class__.__name__ if type_ not in self.ALLOWED_EXCEPTIONS: type_ = None @@ -235,6 +238,7 @@ class HTTPApplication(object): 'id': payload.get('id'), 'error': { 'message': e.message, + 'traceback': tb_info, 'type': type_ } }