Skip to content

Commit

Permalink
external repo: make NoOutputInExternalRepo path-aware
Browse files Browse the repository at this point in the history
  • Loading branch information
pared committed Nov 19, 2019
1 parent 5a92c46 commit d1094c4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions dvc/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
)

Expand Down Expand Up @@ -342,7 +343,9 @@ def __init__(self, url, cause=None):


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
)
)
2 changes: 1 addition & 1 deletion dvc/external_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit d1094c4

Please sign in to comment.