loom.core.errors

exception loom.core.errors.Conflict(message)[source]

Bases: DomainError

Raised when an operation conflicts with existing state.

Parameters:

message (str) – Description of the conflicting condition.

Return type:

None

exception loom.core.errors.DomainError(message, *, code)[source]

Bases: LoomError

Base class for all business-logic errors.

Raised inside UseCase execution. Transport adapters catch and convert these to their own error representations.

Parameters:
Return type:

None

exception loom.core.errors.Forbidden(message='Forbidden')[source]

Bases: DomainError

Raised when an action is not permitted for the caller.

Parameters:

message (str) – Description of the access restriction.

Return type:

None

exception loom.core.errors.LoomError(message, *, code)[source]

Bases: Exception

Base class for all framework errors.

Carries a machine-readable code used by transport adapters to produce appropriate responses (HTTP status, dead-letter routing, etc.) without coupling the domain to any transport layer.

Parameters:
  • message (str) – Human-readable description of the error.

  • code (str) – Machine-readable discriminator (e.g. "not_found").

Return type:

None

Example:

raise NotFound("User", id=42)
exception loom.core.errors.NotFound(entity, *, id)[source]

Bases: DomainError

Raised when a requested entity does not exist.

Emitted automatically by LoadStep when a repository returns None. May also be raised explicitly inside execute for semantic not-found conditions.

Parameters:
  • entity (str) – Name of the missing entity type (e.g. "User").

  • id (Any) – Lookup key that yielded no result.

Return type:

None

Example:

raise NotFound("User", id=42)
exception loom.core.errors.SystemError(message)[source]

Bases: LoomError

Base class for infrastructure and unexpected errors.

Raised when a repository, external service, or internal subsystem fails. Transport adapters may retry on SystemError and dead-letter on DomainError.

Parameters:

message (str) – Description of the system failure.

Return type:

None