mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
exceptions: remove noop code
This commit is contained in:
+2
-16
@@ -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):
|
||||
|
||||
@@ -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
@@ -71,8 +71,7 @@ class StageFileIsNotDvcFileError(DvcException):
|
||||
|
||||
|
||||
class StageFileBadNameError(DvcException):
|
||||
def __init__(self, msg):
|
||||
super().__init__(msg)
|
||||
pass
|
||||
|
||||
|
||||
class StagePathOutsideError(DvcException):
|
||||
|
||||
Reference in New Issue
Block a user