mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-19 23:11:44 +01:00
NoRemoteInExternalRepoError: dont pass cause of exception
This commit is contained in:
+4
-5
@@ -332,13 +332,12 @@ class CollectCacheError(DvcException):
|
||||
pass
|
||||
|
||||
|
||||
class RemoteNotSpecifiedInExternalRepoError(DvcException):
|
||||
def __init__(self, url, cause=None):
|
||||
super(RemoteNotSpecifiedInExternalRepoError, self).__init__(
|
||||
class NoRemoteInExternalRepoError(DvcException):
|
||||
def __init__(self, url):
|
||||
super(NoRemoteInExternalRepoError, self).__init__(
|
||||
"No DVC remote is specified in the target repository '{}'".format(
|
||||
url
|
||||
),
|
||||
cause=cause,
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ from distutils.dir_util import copy_tree
|
||||
from funcy import retry
|
||||
|
||||
from dvc.config import NoRemoteError
|
||||
from dvc.exceptions import RemoteNotSpecifiedInExternalRepoError
|
||||
from dvc.exceptions import NoRemoteInExternalRepoError
|
||||
from dvc.exceptions import NoOutputInExternalRepoError
|
||||
from dvc.exceptions import OutputNotFoundError
|
||||
from dvc.utils.fs import remove
|
||||
@@ -25,8 +25,8 @@ def external_repo(url=None, rev=None, rev_lock=None, cache_dir=None):
|
||||
repo = Repo(path)
|
||||
try:
|
||||
yield repo
|
||||
except NoRemoteError as exc:
|
||||
raise RemoteNotSpecifiedInExternalRepoError(url, cause=exc)
|
||||
except NoRemoteError:
|
||||
raise NoRemoteInExternalRepoError(url)
|
||||
except OutputNotFoundError as exc:
|
||||
if exc.repo is repo:
|
||||
raise NoOutputInExternalRepoError(exc.output, repo.root_dir, url)
|
||||
|
||||
Reference in New Issue
Block a user