diff --git a/dvc/exceptions.py b/dvc/exceptions.py index f65f307136..6bc38fb535 100644 --- a/dvc/exceptions.py +++ b/dvc/exceptions.py @@ -157,9 +157,9 @@ class InitError(DvcException): class ReproductionError(DvcException): - def __init__(self, dvc_file_name): - self.path = dvc_file_name - super().__init__(f"failed to reproduce '{dvc_file_name}'") + def __init__(self, name): + self.name = name + super().__init__(f"failed to reproduce '{name}'") class BadMetricError(DvcException): diff --git a/dvc/repo/reproduce.py b/dvc/repo/reproduce.py index 3b2116ec9f..cc252b72be 100644 --- a/dvc/repo/reproduce.py +++ b/dvc/repo/reproduce.py @@ -218,7 +218,7 @@ def _reproduce_stages( except CheckpointKilledError: raise except Exception as exc: - raise ReproductionError(stage.relpath) from exc + raise ReproductionError(stage.addressing) from exc if on_unchanged is not None: on_unchanged(unchanged) diff --git a/tests/func/experiments/test_experiments.py b/tests/func/experiments/test_experiments.py index 5019602b90..c71570f2c6 100644 --- a/tests/func/experiments/test_experiments.py +++ b/tests/func/experiments/test_experiments.py @@ -97,7 +97,7 @@ def test_failed_exp(tmp_dir, scm, dvc, exp_stage, mocker, caplog): mocker.patch( "concurrent.futures.Future.exception", - return_value=ReproductionError(exp_stage.relpath), + return_value=ReproductionError(exp_stage.addressing), ) with caplog.at_level(logging.ERROR): dvc.experiments.run(exp_stage.addressing, tmp_dir=True)