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..dd18226bd6 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], ...] @@ -116,6 +117,7 @@ def __init__( ): errors = validation_error.errors() + component_name = data[EcalcYamlKeywords.name] messages = [] error_locs = [] try: @@ -126,7 +128,7 @@ 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") + messages.append(f"{component_name} - {error_location_info}:\n\t{error_message}\n") except Exception as e: logger.debug(f"Failed to add location specific error messages: {str(e)}")