From a0c7a7e8ca9bed3f3663084f38aacacb7d778d69 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Thu, 10 Apr 2025 14:01:53 +0200 Subject: [PATCH] Added exception for debugging --- app/utils/configuration_resolver.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/utils/configuration_resolver.py b/app/utils/configuration_resolver.py index 5dc7177..4c2edc5 100644 --- a/app/utils/configuration_resolver.py +++ b/app/utils/configuration_resolver.py @@ -114,8 +114,14 @@ class ConfigurationResolver: key = next((k for k in current if self._mapped_key(k) == part), None) # If no fitting key was found search in the children if key is None: + if "children" not in current: + raise KeyError( + f"No 'children' found in current dictionary. Path so far: {' > '.join(parts[:parts.index(part)+1])}. " + f"Current dictionary: {current}" + ) # The following line seems buggy; Why is children loaded allways and not just when children is set? current = self._find_by_name(current["children"],part) + if not current: raise KeyError( f"Key '{part}' not found in dictionary. Path so far: {' > '.join(parts[:parts.index(part)+1])}. "