mirror of
https://github.com/pim-n/pg-rad
synced 2026-03-11 19:58:11 +01:00
26 lines
696 B
Python
26 lines
696 B
Python
class ConvergenceError(Exception):
|
|
"""Raised when an algorithm fails to converge."""
|
|
|
|
|
|
class DataLoadError(Exception):
|
|
"""Base class for data loading errors."""
|
|
|
|
|
|
class InvalidCSVError(DataLoadError):
|
|
"""Raised when a file is not a valid CSV."""
|
|
|
|
|
|
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)
|