Skip to content

errors

errors

The versioned memory error taxonomy, errors/1.

One list, owned here; every memory part cites it rather than restating it. A backend raises a typed :class:MemoryBackendError subclass whose code is the wire code the gateway returns to a musician. subtype carries the backend-native reason (custody_violation, claim_mismatch...) and remedy names the action that clears it.

Classes

ErrorCode

Bases: str, Enum

The eleven errors/1 codes. Member name is the wire code.

WireError

Bases: TypedDict

The error object a gateway returns for a failed memory call.

MemoryBackendError

MemoryBackendError(detail, *, subtype='', remedy='')

Bases: Exception

Base of every typed memory failure.

Deliberately not derived from the builtin MemoryError (which means the interpreter ran out of RAM). Construct a subclass, never this base.

Source code in src/marianne/memory/errors.py
def __init__(self, detail: str, *, subtype: str = "", remedy: str = "") -> None:
    self.detail = detail
    self.subtype = subtype or self.code.value
    self.remedy = remedy
    text = f"{self.code.name} {self.code.value}"
    if self.subtype != self.code.value:
        text += f" ({self.subtype})"
    text += f": {detail}"
    if remedy:
        text += f" — remedy: {remedy}"
    super().__init__(text)
Methods:
to_wire
to_wire()

Serialise for the gateway's tool-call error response.

Source code in src/marianne/memory/errors.py
def to_wire(self) -> WireError:
    """Serialise for the gateway's tool-call error response."""
    return {
        "code": self.code.name,
        "name": self.code.value,
        "subtype": self.subtype,
        "detail": self.detail,
        "remedy": self.remedy,
    }

Unauthenticated

Unauthenticated(detail, *, subtype='', remedy='')

Bases: MemoryBackendError

E1: peer credentials missing or wrong for this endpoint.

Source code in src/marianne/memory/errors.py
def __init__(self, detail: str, *, subtype: str = "", remedy: str = "") -> None:
    self.detail = detail
    self.subtype = subtype or self.code.value
    self.remedy = remedy
    text = f"{self.code.name} {self.code.value}"
    if self.subtype != self.code.value:
        text += f" ({self.subtype})"
    text += f": {detail}"
    if remedy:
        text += f" — remedy: {remedy}"
    super().__init__(text)

PermissionDenied

PermissionDenied(detail, *, subtype='', remedy='')

Bases: MemoryBackendError

E2: the session lacks the permission the operation needs.

Source code in src/marianne/memory/errors.py
def __init__(self, detail: str, *, subtype: str = "", remedy: str = "") -> None:
    self.detail = detail
    self.subtype = subtype or self.code.value
    self.remedy = remedy
    text = f"{self.code.name} {self.code.value}"
    if self.subtype != self.code.value:
        text += f" ({self.subtype})"
    text += f": {detail}"
    if remedy:
        text += f" — remedy: {remedy}"
    super().__init__(text)

ScopeRefused

ScopeRefused(detail, *, subtype='', remedy='')

Bases: MemoryBackendError

E3: scope expression malformed or outside the authorised scope.

Source code in src/marianne/memory/errors.py
def __init__(self, detail: str, *, subtype: str = "", remedy: str = "") -> None:
    self.detail = detail
    self.subtype = subtype or self.code.value
    self.remedy = remedy
    text = f"{self.code.name} {self.code.value}"
    if self.subtype != self.code.value:
        text += f" ({self.subtype})"
    text += f": {detail}"
    if remedy:
        text += f" — remedy: {remedy}"
    super().__init__(text)

RecallCapExceeded

RecallCapExceeded(detail, *, subtype='', remedy='')

Bases: MemoryBackendError

E4: the dispatch's cumulative recall quota is spent.

Source code in src/marianne/memory/errors.py
def __init__(self, detail: str, *, subtype: str = "", remedy: str = "") -> None:
    self.detail = detail
    self.subtype = subtype or self.code.value
    self.remedy = remedy
    text = f"{self.code.name} {self.code.value}"
    if self.subtype != self.code.value:
        text += f" ({self.subtype})"
    text += f": {detail}"
    if remedy:
        text += f" — remedy: {remedy}"
    super().__init__(text)

BackendUnreachable

BackendUnreachable(detail, *, subtype='', remedy='')

Bases: MemoryBackendError

E5: the backend cannot be reached or its storage cannot be opened.

Source code in src/marianne/memory/errors.py
def __init__(self, detail: str, *, subtype: str = "", remedy: str = "") -> None:
    self.detail = detail
    self.subtype = subtype or self.code.value
    self.remedy = remedy
    text = f"{self.code.name} {self.code.value}"
    if self.subtype != self.code.value:
        text += f" ({self.subtype})"
    text += f": {detail}"
    if remedy:
        text += f" — remedy: {remedy}"
    super().__init__(text)

DeadBackend

DeadBackend(detail, *, subtype='', remedy='')

Bases: MemoryBackendError

E6: reserved — the backend died mid-session.

Source code in src/marianne/memory/errors.py
def __init__(self, detail: str, *, subtype: str = "", remedy: str = "") -> None:
    self.detail = detail
    self.subtype = subtype or self.code.value
    self.remedy = remedy
    text = f"{self.code.name} {self.code.value}"
    if self.subtype != self.code.value:
        text += f" ({self.subtype})"
    text += f": {detail}"
    if remedy:
        text += f" — remedy: {remedy}"
    super().__init__(text)

SchemaViolation

SchemaViolation(detail, *, subtype='', remedy='')

Bases: MemoryBackendError

E7: an argument or configuration value fails the contract.

Source code in src/marianne/memory/errors.py
def __init__(self, detail: str, *, subtype: str = "", remedy: str = "") -> None:
    self.detail = detail
    self.subtype = subtype or self.code.value
    self.remedy = remedy
    text = f"{self.code.name} {self.code.value}"
    if self.subtype != self.code.value:
        text += f" ({self.subtype})"
    text += f": {detail}"
    if remedy:
        text += f" — remedy: {remedy}"
    super().__init__(text)

AuthorityRevoked

AuthorityRevoked(detail, *, subtype='', remedy='')

Bases: MemoryBackendError

E8: the session's authority epoch is stale (grant revoked).

Source code in src/marianne/memory/errors.py
def __init__(self, detail: str, *, subtype: str = "", remedy: str = "") -> None:
    self.detail = detail
    self.subtype = subtype or self.code.value
    self.remedy = remedy
    text = f"{self.code.name} {self.code.value}"
    if self.subtype != self.code.value:
        text += f" ({self.subtype})"
    text += f": {detail}"
    if remedy:
        text += f" — remedy: {remedy}"
    super().__init__(text)

LockTimeout

LockTimeout(detail, *, subtype='', remedy='')

Bases: MemoryBackendError

E9: lock acquisition did not succeed within the call's budget.

Source code in src/marianne/memory/errors.py
def __init__(self, detail: str, *, subtype: str = "", remedy: str = "") -> None:
    self.detail = detail
    self.subtype = subtype or self.code.value
    self.remedy = remedy
    text = f"{self.code.name} {self.code.value}"
    if self.subtype != self.code.value:
        text += f" ({self.subtype})"
    text += f": {detail}"
    if remedy:
        text += f" — remedy: {remedy}"
    super().__init__(text)

DeadlineExceeded

DeadlineExceeded(detail, *, subtype='', remedy='')

Bases: MemoryBackendError

E10: the call deadline passed before mutation began.

Source code in src/marianne/memory/errors.py
def __init__(self, detail: str, *, subtype: str = "", remedy: str = "") -> None:
    self.detail = detail
    self.subtype = subtype or self.code.value
    self.remedy = remedy
    text = f"{self.code.name} {self.code.value}"
    if self.subtype != self.code.value:
        text += f" ({self.subtype})"
    text += f": {detail}"
    if remedy:
        text += f" — remedy: {remedy}"
    super().__init__(text)

NotFound

NotFound(detail, *, subtype='', remedy='')

Bases: MemoryBackendError

E11: the fact, unit or attachment does not exist in the bound store.

Source code in src/marianne/memory/errors.py
def __init__(self, detail: str, *, subtype: str = "", remedy: str = "") -> None:
    self.detail = detail
    self.subtype = subtype or self.code.value
    self.remedy = remedy
    text = f"{self.code.name} {self.code.value}"
    if self.subtype != self.code.value:
        text += f" ({self.subtype})"
    text += f": {detail}"
    if remedy:
        text += f" — remedy: {remedy}"
    super().__init__(text)