From b40cdfbdacff55ce162faa1347255e05b61a64ce Mon Sep 17 00:00:00 2001 From: Marcin Kuzminski Date: Sat, 16 Dec 2017 16:05:38 +0100 Subject: [PATCH] logging: log traceback for errors that are known to help debugging. --- rhodecode/lib/vcs/exceptions.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/rhodecode/lib/vcs/exceptions.py b/rhodecode/lib/vcs/exceptions.py index 93b543cb..e142c11f 100644 --- a/rhodecode/lib/vcs/exceptions.py +++ b/rhodecode/lib/vcs/exceptions.py @@ -21,10 +21,12 @@ """ Custom vcs exceptions module. """ - +import logging import functools import urllib2 +log = logging.getLogger(__name__) + class VCSCommunicationError(Exception): pass @@ -203,7 +205,10 @@ def map_vcs_exceptions(func): args = e.args else: args = [__traceback_info__ or 'unhandledException'] - + if __traceback_info__ and kind != 'unhandled': + # for other than unhandled errors also log the traceback + # can be usefull for debugging + log.error(__traceback_info__) raise _EXCEPTION_MAP[kind](*args) else: raise