mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-08 23:09:48 +01:00
import: intercept and rephrase OutputNotFound message
This commit is contained in:
@@ -338,3 +338,12 @@ class RemoteNotSpecifiedInExternalRepoError(DvcException):
|
||||
),
|
||||
cause=cause,
|
||||
)
|
||||
|
||||
|
||||
class NoOutputInExternalRepoError(DvcException):
|
||||
def __init__(self, repo_url, path):
|
||||
super(NoOutputInExternalRepoError, self).__init__(
|
||||
"Output '{}' not found in target repository: '{}'".format(
|
||||
path, repo_url
|
||||
)
|
||||
)
|
||||
|
||||
+8
-1
@@ -1,6 +1,13 @@
|
||||
from dvc.exceptions import NoOutputInExternalRepoError
|
||||
from dvc.exceptions import OutputNotFoundError
|
||||
|
||||
|
||||
def imp(self, url, path, out=None, rev=None):
|
||||
erepo = {"url": url}
|
||||
if rev is not None:
|
||||
erepo["rev"] = rev
|
||||
|
||||
return self.imp_url(path, out=out, erepo=erepo, locked=True)
|
||||
try:
|
||||
return self.imp_url(path, out=out, erepo=erepo, locked=True)
|
||||
except OutputNotFoundError:
|
||||
raise NoOutputInExternalRepoError(url, path)
|
||||
|
||||
Reference in New Issue
Block a user