diff --git a/dvc/repo/fetch.py b/dvc/repo/fetch.py index 51e8634a85..b51e49b0fe 100644 --- a/dvc/repo/fetch.py +++ b/dvc/repo/fetch.py @@ -57,7 +57,7 @@ def fetch( # noqa: C901, PLR0913 indexes = [] index_keys = set() - for _ in self.brancher( + for rev in self.brancher( revs=revs, all_branches=all_branches, all_tags=all_tags, @@ -77,6 +77,12 @@ def fetch( # noqa: C901, PLR0913 ) index_keys.add(idx.data_tree.hash_info.value) indexes.append(idx.data["repo"]) + except Exception: # pylint: disable=broad-except + failed_count += 1 + logger.exception( + "failed to collect '%s'", + rev or "workspace", + ) finally: if remote: self.config["core"]["remote"] = saved_remote