dvc: replace StageNotFoundError with NotDvcFileError

Fixes #760

Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
Ruslan Kuprieiev
2018-06-13 14:00:03 +03:00
parent 0ffcdd669a
commit 78e5b166fe
5 changed files with 13 additions and 22 deletions
+1 -12
View File
@@ -1,7 +1,7 @@
import os
from dvc.command.common.base import CmdBase
from dvc.project import ReproductionError, StageNotFoundError
from dvc.project import ReproductionError
from dvc.stage import Stage
@@ -23,17 +23,6 @@ class CmdRepro(CmdBase):
self.project.logger.error(msg, ex)
ret = 1
break
except StageNotFoundError as ex:
if os.path.exists(target):
msg = '\'{}\' is not a dvc file.'.format(target)
dvcfile = target + Stage.STAGE_FILE_SUFFIX
if os.path.exists(target) and os.path.isfile(dvcfile):
msg += ' Maybe you meant \'{}\'?'.format(dvcfile)
else:
msg = '\'{}\' does not exist.'.format(target)
self.project.logger.error(msg)
ret = 1
break
except Exception as ex:
msg = 'Failed to reproduce \'{}\' - unexpected error'.format(target)
self.project.logger.error(msg, ex)