add MissingSubKeyError for config loading. update main.py for --config flag

This commit is contained in:
Pim Nelissen
2026-02-20 11:47:38 +01:00
parent 265d3b0111
commit cca514a2ba
2 changed files with 47 additions and 4 deletions

View File

@ -12,3 +12,14 @@ class InvalidCSVError(DataLoadError):
class OutOfBoundsError(Exception):
"""Raised when an object is attempted to be placed out of bounds."""
class MissingNestedKeyError(Exception):
"""Raised when a nested key is missing in the config."""
def __init__(self, key, subkey=None):
if subkey:
self.message = f"Missing key in {key}: {subkey}"
else:
self.message = f"Missing key: {key}"
super().__init__(self.message)