diff --git a/dvc/command/remove.py b/dvc/command/remove.py index c2dab5e7a1..8b2ef4d8d7 100644 --- a/dvc/command/remove.py +++ b/dvc/command/remove.py @@ -13,8 +13,8 @@ def run(self): for target in self.args.targets: try: self.repo.remove(target, outs=self.args.outs) - except DvcException: - logger.exception(f"failed to remove '{target}'") + except DvcException as exc: + logger.error(exc) return 1 return 0 diff --git a/dvc/stage/exceptions.py b/dvc/stage/exceptions.py index 84d5a86564..1f180b2c6b 100644 --- a/dvc/stage/exceptions.py +++ b/dvc/stage/exceptions.py @@ -81,6 +81,8 @@ def __init__(self, missing_files): class StageNotFound(KeyError, DvcException): + __str__ = DvcException.__str__ + def __init__(self, file, name): self.file = file.relpath self.name = name