destroy: raise exception

Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
Ruslan Kuprieiev
2018-07-19 08:24:55 +03:00
parent bc4a5d78e3
commit e734ad1712
+3 -3
View File
@@ -1,5 +1,6 @@
from dvc.command.base import CmdBase
from dvc.prompt import prompt
from dvc.exceptions import DvcException
class CmdDestroy(CmdBase):
@@ -10,10 +11,9 @@ class CmdDestroy(CmdBase):
u'Are you sure you want to continue?'
if not self.args.force and not prompt(msg, False):
err = u'Cannot destroy without a confirmation from the user. ' \
msg = u'Cannot destroy without a confirmation from the user. ' \
u'Use \'-f\' to force.'
self.project.logger.error(err)
return 1
raise DvcException(err)
self.project.destroy()
except Exception as exc: