external repo: make NoOutputInExternalRepo path-aware

This commit is contained in:
Paweł Redzyński
2019-11-19 14:58:16 +01:00
parent 5a92c46033
commit d1094c41b1
2 changed files with 7 additions and 4 deletions
+6 -3
View File
@@ -60,10 +60,11 @@ class OutputNotFoundError(DvcException):
"""
def __init__(self, output, repo=None):
self.output = output
self.repo = repo
super(OutputNotFoundError, self).__init__(
"unable to find DVC-file with output '{path}'".format(
path=relpath(output)
path=relpath(self.output)
)
)
@@ -342,7 +343,9 @@ class RemoteNotSpecifiedInExternalRepoError(DvcException):
class NoOutputInExternalRepoError(DvcException):
def __init__(self):
def __init__(self, path, external_repo_path, external_repo_url):
super(NoOutputInExternalRepoError, self).__init__(
"Output not found in target repository."
"Output '{}' not found in target repository '{}'".format(
relpath(path, external_repo_path), external_repo_url
)
)
+1 -1
View File
@@ -29,7 +29,7 @@ def external_repo(url=None, rev=None, rev_lock=None, cache_dir=None):
raise RemoteNotSpecifiedInExternalRepoError(url, cause=exc)
except OutputNotFoundError as exc:
if exc.repo is repo:
raise NoOutputInExternalRepoError()
raise NoOutputInExternalRepoError(exc.output, repo.root_dir, url)
raise
repo.close()