exceptions: remove noop code

This commit is contained in:
Mr. Outis
2020-01-02 16:59:56 -06:00
parent fd82402d34
commit aed04e7cc9
3 changed files with 6 additions and 26 deletions
+2 -16
View File
@@ -13,18 +13,6 @@ class DvcException(Exception):
cause (Exception): optional cause exception.
"""
def __init__(self, msg, cause=None):
# NOTE: unlike python 3, python 2 doesn't have built-in support
# for chained exceptions, so we are using our own implementation.
self.cause = cause
self.cause_tb = None
if cause:
try:
self.cause_tb = traceback.format_exc()
except AttributeError: # pragma: no cover
pass
super().__init__(msg)
class OutputDuplicationError(DvcException):
"""Thrown if a file/directory is specified as an output in more than one
@@ -109,8 +97,7 @@ class ArgumentDuplicationError(DvcException):
def __init__(self, path):
assert isinstance(path, str)
msg = "file '{}' is specified more than once."
super().__init__(msg.format(path))
super().__init__("file '{}' is specified more than once.".format(path))
class MoveNotDataSourceError(DvcException):
@@ -175,8 +162,7 @@ class ConfirmRemoveError(DvcException):
class InitError(DvcException):
def __init__(self, msg):
super().__init__(msg)
pass
class ReproductionError(DvcException):
+3 -8
View File
@@ -19,18 +19,13 @@ FOLDER_MIME_TYPE = "application/vnd.google-apps.folder"
class GDriveRetriableError(DvcException):
def __init__(self, msg, cause=None):
super().__init__(msg, cause=cause)
pass
class GDriveAccessTokenRefreshError(DvcException):
def __init__(self, msg, cause=None):
super().__init__(msg, cause=cause)
pass
class GDriveMissedCredentialKeyError(DvcException):
def __init__(self, msg, cause=None):
super().__init__(msg, cause=cause)
pass
@decorator
+1 -2
View File
@@ -71,8 +71,7 @@ class StageFileIsNotDvcFileError(DvcException):
class StageFileBadNameError(DvcException):
def __init__(self, msg):
super().__init__(msg)
pass
class StagePathOutsideError(DvcException):