logging: log traceback for errors that are known to help debugging.

This commit is contained in:
Marcin Kuzminski 2017-12-16 16:05:38 +01:00
parent 9bf25f60d0
commit b40cdfbdac

View file

@ -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