Skip to content

Commit

Permalink
cli: remove: fix error message for the case when file is not under co…
Browse files Browse the repository at this point in the history
…ntrol (#4497) (#5236)

* cli: remove: fix error message for the case when file is not under control (#4497)

* cli: remove: fix error message for the case when file is not under control (#4497)

fixes after code review

* cli: remove: fix error message for the case when file is not under control (#4497)

2nd round of fixes after code review

* cli: remove: fix error message for the case when file is not under control (#4497)

3rd round of fixes after code review
  • Loading branch information
DiPaolo authored Jan 19, 2021
1 parent 407f560 commit 8b0e0b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dvc/command/remove.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions dvc/stage/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8b0e0b9

Please sign in to comment.