From b61ddb7494c0e4701f9d7eef1bfc197612cfcdc9 Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Tue, 13 Feb 2018 13:15:33 +0200 Subject: [PATCH] dvc: use relative paths in exceptions Fixes #448 Signed-off-by: Ruslan Kuprieiev --- dvc/output.py | 2 +- dvc/project.py | 2 +- dvc/stage.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dvc/output.py b/dvc/output.py index 58034769d..f516085af 100644 --- a/dvc/output.py +++ b/dvc/output.py @@ -51,7 +51,7 @@ class Dependency(object): self.path = os.path.abspath(os.path.realpath(path)) if not self.path.startswith(self.project.root_dir): - raise CmdOutputOutsideOfRepoError(self.path) + raise CmdOutputOutsideOfRepoError(self.rel_path) self.md5 = md5 diff --git a/dvc/project.py b/dvc/project.py index 96f6c35de..8050cc30d 100644 --- a/dvc/project.py +++ b/dvc/project.py @@ -152,7 +152,7 @@ class Project(object): try: result += self._reproduce_stage(stages, n, force) except Exception as ex: - raise ReproductionError(n, ex) + raise ReproductionError(stages[n].relpath, ex) return result def checkout(self): diff --git a/dvc/stage.py b/dvc/stage.py index 5eba993f1..e60a85a1d 100644 --- a/dvc/stage.py +++ b/dvc/stage.py @@ -9,7 +9,7 @@ from dvc.output import Output, Dependency, OutputError class StageCmdFailedError(DvcException): def __init__(self, stage): - msg = 'Stage {} cmd {} failed'.format(stage.path, stage.cmd) + msg = 'Stage {} cmd {} failed'.format(stage.relpath, stage.cmd) super(StageCmdFailedError, self).__init__(msg)