Update dvc/external_repo.py

Co-Authored-By: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
Paweł Redzyński
2019-11-13 11:57:53 +01:00
committed by pawel
co-authored by Ruslan Kuprieiev
parent 48d16f6cc5
commit 4a6a1b662d
2 changed files with 5 additions and 4 deletions
+3 -2
View File
@@ -331,9 +331,10 @@ class CollectCacheError(DvcException):
class RemoteNotSpecifiedInExternalRepoError(DvcException):
def __init__(self, url):
def __init__(self, url, cause=None):
super(RemoteNotSpecifiedInExternalRepoError, self).__init__(
"No DVC remote is specified in the target repository '{}'".format(
url
)
),
cause=cause,
)
+2 -2
View File
@@ -23,8 +23,8 @@ def external_repo(url=None, rev=None, rev_lock=None, cache_dir=None):
repo = Repo(path)
try:
yield repo
except NoRemoteError:
raise RemoteNotSpecifiedInExternalRepoError(url)
except NoRemoteError as exc:
raise RemoteNotSpecifiedInExternalRepoError(url, cause=exc)
repo.close()