diff --git a/vcsserver/http_main.py b/vcsserver/http_main.py --- a/vcsserver/http_main.py +++ b/vcsserver/http_main.py @@ -433,7 +433,7 @@ class HTTPApplication(object): should_store_exc = False if should_store_exc: - store_exception(id(exc_info), exc_info) + store_exception(id(exc_info), exc_info, request_path=request.path) tb_info = ''.join( traceback.format_exception(exc_type, exc_value, exc_traceback)) @@ -452,6 +452,7 @@ class HTTPApplication(object): 'type': type_ } } + try: resp['error']['_vcs_kind'] = getattr(e, '_vcs_kind', None) except AttributeError: diff --git a/vcsserver/lib/exc_tracking.py b/vcsserver/lib/exc_tracking.py --- a/vcsserver/lib/exc_tracking.py +++ b/vcsserver/lib/exc_tracking.py @@ -68,7 +68,7 @@ def get_exc_store(): return _exc_store_path -def _store_exception(exc_id, exc_info, prefix): +def _store_exception(exc_id, exc_info, prefix, request_path=''): exc_type, exc_value, exc_traceback = exc_info tb = ''.join(traceback.format_exception( @@ -101,8 +101,13 @@ def _store_exception(exc_id, exc_info, p f.write(exc_data) log.debug('Stored generated exception %s as: %s', exc_id, stored_exc_path) + log.error( + 'error occurred handling this request.\n' + 'Path: `%s`, tb: %s', + request_path, tb) -def store_exception(exc_id, exc_info, prefix=global_prefix): + +def store_exception(exc_id, exc_info, prefix=global_prefix, request_path=''): """ Example usage:: @@ -111,7 +116,8 @@ def store_exception(exc_id, exc_info, pr """ try: - _store_exception(exc_id=exc_id, exc_info=exc_info, prefix=prefix) + _store_exception(exc_id=exc_id, exc_info=exc_info, prefix=prefix, + request_path=request_path) except Exception: log.exception('Failed to store exception `%s` information', exc_id) # there's no way this can fail, it will crash server badly if it does.