From ad873497cde39dccba2b35cd4715ed54191d1123 Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Sun, 26 Nov 2017 13:59:39 +0200 Subject: [PATCH] RFC: redo repro's init Signed-off-by: Ruslan Kuprieiev --- dvc/command/repro.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/dvc/command/repro.py b/dvc/command/repro.py index 42cb46bc1..2faedc9ca 100644 --- a/dvc/command/repro.py +++ b/dvc/command/repro.py @@ -89,11 +89,7 @@ class ReproChange(object): self._recursive = recursive self._force = force - try: - self.state = StateFile.load(data_item, self.settings) - except Exception as ex: - raise ReproError('Error: state file "{}" cannot be loaded: {}'. - format(data_item.state.relative, ex)) + self.state = StateFile.load(data_item, self.settings) if isinstance(self.state.command, str): self.command = CommandFile.load(self.state.command) @@ -101,8 +97,8 @@ class ReproChange(object): self.command = CommandFile.loadd(self.state.command) if not self.command.cmd and not self.command.locked: - raise ReproError('Error: parameter {} is not defined in "{}"'. - format(CommandFile.PARAM_CMD, self.command.fname if self.command.fname else data_item.state.relative)) + msg = 'Error: data item "{}" is not locked, but has no command for reproduction' + raise ReproError(msg.format(data_item.data.dvc)) self._settings = copy.copy(self._cmd_obj.settings)