Skip to content

fathom.ScopeError

fathom.ScopeError

Bases: FathomError, RuntimeError

Raised when an operation is attempted at the wrong scope.

E.g. asserting a fleet-scoped fact through Engine.assert_fact instead of FleetEngine.assert_fact.

Inherits RuntimeError as well as :class:FathomError so pre-1.0 except RuntimeError call sites keep working.

Source code in src/fathom/errors.py
class ScopeError(FathomError, RuntimeError):
    """Raised when an operation is attempted at the wrong scope.

    E.g. asserting a fleet-scoped fact through ``Engine.assert_fact`` instead
    of ``FleetEngine.assert_fact``.

    Inherits ``RuntimeError`` as well as :class:`FathomError` so pre-1.0
    ``except RuntimeError`` call sites keep working.
    """