diff --git a/src/ecalc/libraries/libecalc/common/libecalc/input/validation_errors.py b/src/ecalc/libraries/libecalc/common/libecalc/input/validation_errors.py index 6c5e0ed254..debb1b6dbf 100644 --- a/src/ecalc/libraries/libecalc/common/libecalc/input/validation_errors.py +++ b/src/ecalc/libraries/libecalc/common/libecalc/input/validation_errors.py @@ -7,6 +7,7 @@ import yaml from libecalc.common.logger import logger from libecalc.input.yaml_entities import Resource, YamlDict, YamlList +from libecalc.input.yaml_keywords import EcalcYamlKeywords from yaml import Dumper, Mark Loc = Tuple[Union[int, str], ...] @@ -126,7 +127,10 @@ def __init__( error_location_info = " -> ".join( [str(s).capitalize().replace("__root__", "General error").replace("_", " ") for s in error_loc] ) - messages.append(f"{error_location_info}:\n\t{error_message}\n") + if component_name := data.get(EcalcYamlKeywords.name): + messages.append(f"{component_name} - {error_location_info}:\n\t{error_message}\n") + else: + messages.append(f"{error_location_info}:\n\t{error_message}\n") except Exception as e: logger.debug(f"Failed to add location specific error messages: {str(e)}")