mirror of
https://github.com/pim-n/pg-rad
synced 2026-03-11 19:58:11 +01:00
add MissingSubKeyError for config loading. update main.py for --config flag
This commit is contained in:
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user