diff --git a/dvc/command/get.py b/dvc/command/get.py index eb0decf39..1386d8ca4 100644 --- a/dvc/command/get.py +++ b/dvc/command/get.py @@ -3,7 +3,7 @@ import logging from .base import append_doc_link from .base import CmdBaseNoRepo -from dvc.exceptions import DvcException, NotDvcRepoError +from dvc.exceptions import DvcException logger = logging.getLogger(__name__) @@ -18,23 +18,8 @@ class CmdGet(CmdBaseNoRepo): self.args.path, repo=self.args.url, rev=self.args.rev ) logger.info(url) - except NotDvcRepoError: - # NOTE: there's no way to get direct links to files inside - # git repository. - logger.exception( - "Could not show url for '{}' from '{}'. ".format( - self.args.path, self.args.url - ) - + "Only DVC repository is supported currently.", - exc_info=None, - ) - return 1 except DvcException: - logger.exception( - "failed to show url for '{}' from '{}'".format( - self.args.path, self.args.url - ) - ) + logger.exception("failed to show url") return 1 return 0 diff --git a/tests/func/test_get.py b/tests/func/test_get.py index a208a99d2..87d8ceea3 100644 --- a/tests/func/test_get.py +++ b/tests/func/test_get.py @@ -203,7 +203,7 @@ def test_get_url_not_existing(tmp_dir, erepo_dir, caplog): main(["get", fspath(erepo_dir), "not-existing-file", "--show-url"]) == 1 ) - assert "failed to show url for 'not-existing-file'" in caplog.text + assert "failed to show url" in caplog.text def test_get_url_git_only_repo(tmp_dir, scm, caplog): @@ -211,4 +211,4 @@ def test_get_url_git_only_repo(tmp_dir, scm, caplog): with caplog.at_level(logging.ERROR): assert main(["get", fspath(tmp_dir), "foo", "--show-url"]) == 1 - assert "Only DVC repository is supported currently" in caplog.text + assert "failed to show url" in caplog.text