From a146acaf03d929119a95e34524baf52cdfd3f0a8 Mon Sep 17 00:00:00 2001 From: Sebastian Brommer Date: Thu, 11 Apr 2024 15:15:39 +0200 Subject: [PATCH] add error handeling for validation errors --- code_generation/configuration.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/code_generation/configuration.py b/code_generation/configuration.py index fbefbc76..39f88c14 100644 --- a/code_generation/configuration.py +++ b/code_generation/configuration.py @@ -697,9 +697,21 @@ def _validate_parameters(self) -> None: required_parameters = {} for scope in self.scopes: + log.debug(" Collecting required parameters for scope {}".format(scope)) required_parameters[scope] = set() for producer in self.producers[scope]: - required_parameters[scope] |= producer.parameters[scope] + log.debug(" Collecting parameters for producer {}".format(producer)) + try: + required_parameters[scope] |= producer.parameters[scope] + except KeyError: + log.error( + f"Producer {producer} is not correctly setup for scope {scope}" + ) + raise ConfigurationError( + "Producer {} is not correctly setup for scope {}".format( + producer, scope + ) + ) # now check, which parameters are set in the configuration, but not used by any producer for scope in self.scopes: log.info("------------------------------------")