exceptions: catch format_exc() exception

Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
Ruslan Kuprieiev
2018-04-05 21:31:20 +03:00
parent a948f5ca90
commit 728c08695f
+6 -1
View File
@@ -4,5 +4,10 @@ import traceback
class DvcException(Exception):
def __init__(self, msg, cause=None):
self.cause = cause
self.cause_tb = traceback.format_exc() if cause else None
self.case_tb = None
if cause:
try:
self.cause_tb = traceback.format_exc()
except Exception:
pass
super(DvcException, self).__init__(msg)