diff --git a/dvc/exceptions.py b/dvc/exceptions.py index ce30ffa88..92f46a882 100644 --- a/dvc/exceptions.py +++ b/dvc/exceptions.py @@ -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 + ) ) diff --git a/dvc/external_repo.py b/dvc/external_repo.py index e86c02926..0555f2d75 100644 --- a/dvc/external_repo.py +++ b/dvc/external_repo.py @@ -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()