diff --git a/src/pvframework/mapped_validators/path_map.py b/src/pvframework/mapped_validators/path_map.py index 37b1b71..715f83a 100644 --- a/src/pvframework/mapped_validators/path_map.py +++ b/src/pvframework/mapped_validators/path_map.py @@ -69,7 +69,7 @@ def provide(self, data_set: DataSetT) -> Generator[Parameters[DataSetT] | Except if param_name in self.validator.required_param_names: query_error = AttributeError(f"{attr_path} not provided") query_error.__cause__ = error - yield error + yield query_error skip = True break value = self.validator.signature.parameters[param_name].default diff --git a/src/pvframework/mapped_validators/query_map.py b/src/pvframework/mapped_validators/query_map.py index 8bbd077..13d1930 100644 --- a/src/pvframework/mapped_validators/query_map.py +++ b/src/pvframework/mapped_validators/query_map.py @@ -179,7 +179,7 @@ def provide(self, data_set: DataSetT) -> Generator[Parameters[DataSetT] | Except if isinstance(param_value, Exception): assert param_name in self.validator.optional_param_names, ( "If the parameter is required but not supplied you should yield an exception " - "in `paran_sets` directly. The dictionary of parameters should only contain exceptions if" + "in `param_sets` directly. The dictionary of parameters should only contain exceptions if" "they are negligible aka the parameter is optional." ) parameter_dict[param_name] = Parameter( diff --git a/unittests/test_validation.py b/unittests/test_validation.py index 13d941a..1fcdc35 100644 --- a/unittests/test_validation.py +++ b/unittests/test_validation.py @@ -402,7 +402,7 @@ async def test_unprovided_but_required(self): validation_summary = await validation_manager.validate(dataset_instance) assert validation_summary.num_errors_total == 1 - assert "'z.z' does not exist" in str(validation_summary.all_errors[0]) + assert "z.z not provided" in str(validation_summary.all_errors[0]) async def test_multiple_validator_registration(self): global finishing_order