Skip to content

Commit 31aed9b

Browse files
committed
NoRemoteInExternalRepoError: dont pass cause of exception
1 parent f9d4ef8 commit 31aed9b

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

dvc/exceptions.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -332,13 +332,12 @@ class CollectCacheError(DvcException):
332332
pass
333333

334334

335-
class RemoteNotSpecifiedInExternalRepoError(DvcException):
336-
def __init__(self, url, cause=None):
337-
super(RemoteNotSpecifiedInExternalRepoError, self).__init__(
335+
class NoRemoteInExternalRepoError(DvcException):
336+
def __init__(self, url):
337+
super(NoRemoteInExternalRepoError, self).__init__(
338338
"No DVC remote is specified in the target repository '{}'".format(
339339
url
340-
),
341-
cause=cause,
340+
)
342341
)
343342

344343

dvc/external_repo.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from funcy import retry
99

1010
from dvc.config import NoRemoteError
11-
from dvc.exceptions import RemoteNotSpecifiedInExternalRepoError
11+
from dvc.exceptions import NoRemoteInExternalRepoError
1212
from dvc.exceptions import NoOutputInExternalRepoError
1313
from dvc.exceptions import OutputNotFoundError
1414
from dvc.utils.fs import remove
@@ -25,8 +25,8 @@ def external_repo(url=None, rev=None, rev_lock=None, cache_dir=None):
2525
repo = Repo(path)
2626
try:
2727
yield repo
28-
except NoRemoteError as exc:
29-
raise RemoteNotSpecifiedInExternalRepoError(url, cause=exc)
28+
except NoRemoteError:
29+
raise NoRemoteInExternalRepoError(url)
3030
except OutputNotFoundError as exc:
3131
if exc.repo is repo:
3232
raise NoOutputInExternalRepoError(exc.output, repo.root_dir, url)

0 commit comments

Comments
 (0)