Source code for bluebase.core.error

from typing import (
    Any,
    ClassVar,
)

from .util import dump


__all__ = (
    'BbError',
)


[docs] class BbError(Exception): """ A base error for BlueBase. Attributes: info: detailed error information """ message: ClassVar[str] """An error message to be shown.""" info: dict[str, Any] def __init__(self, **kwargs) -> None: super().__init__(self.message) self.info = kwargs def __str__(self) -> str: # pragma: no cover if not __debug__ or not self.info: return f"{self.message}." return f"{self.message} ({dump(**self.info)})."