"""PyMAB's public exception hierarchy."""
from __future__ import annotations
[docs]
class PyMABError(Exception):
"""Base class for errors raised by PyMAB."""
[docs]
class ValidationError(PyMABError, ValueError):
"""Raised when external data or configuration violates a contract."""
[docs]
class CompatibilityError(PyMABError, TypeError):
"""Raised when two valid components cannot be used together."""
[docs]
class OverlapError(ValidationError):
"""Raised when logged data cannot identify an off-policy estimate."""
[docs]
class SerializationError(PyMABError):
"""Raised when a persisted result cannot be encoded or decoded safely."""
__all__ = [
"CompatibilityError",
"OverlapError",
"PyMABError",
"SerializationError",
"ValidationError",
]