Skip to content

Commit

Permalink
[INTERNAL] Log error when fails yaml load
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbertodelaCruz committed May 6, 2024
1 parent 50614e6 commit b3c3256
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion infcommon/yaml_reader/yaml_loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import yaml

from infcommon.yaml_reader.exceptions import DuplicatedKeyError
from infcommon import logger


class DirectoryYamlLoader:
Expand Down Expand Up @@ -37,7 +38,8 @@ def _load_data_from_file(self, filename):
else:
content.append(line)
return yaml.load(''.join(content), Loader=yaml.FullLoader)
except yaml.YAMLError:
except yaml.YAMLError as exc:
logger.error(f"Error loading file: {filename} {exc}")
return {}

def _keys_are_already_used(self, all_dict, current_dict):
Expand Down

0 comments on commit b3c3256

Please sign in to comment.