pub enum Error {
MailboxClosed,
BrokerAlreadyStarted,
MailboxFull,
DuplicateActorName(ActorId),
External(Arc<dyn Error + Send + Sync>),
IoError(Arc<Error>),
Internal(Arc<dyn Error + Send + Sync>),
SettleTimeout(Duration, usize),
}Expand description
The single error type for all Maiko operations.
Every fallible Maiko API returns maiko::Result<T> (alias for
Result<T, maiko::Error>). Errors from lower layers (Tokio channels,
IO, task joins) are mapped into variants of this enum so callers only
need to handle one error type.
Variants§
MailboxClosed
The actor’s mailbox channel was closed (actor or broker shut down).
BrokerAlreadyStarted
Attempted to start the broker when it is already running.
MailboxFull
The actor’s mailbox is full and the overflow policy rejected the event.
DuplicateActorName(ActorId)
An actor with this name is already registered.
External(Arc<dyn Error + Send + Sync>)
An application-level error wrapped via Error::external().
IoError(Arc<Error>)
An I/O error from the underlying system.
Internal(Arc<dyn Error + Send + Sync>)
An internal Maiko error (e.g., task join failure).
SettleTimeout(Duration, usize)
test-harness only.A settle_on condition was not
met within the timeout. Contains the timeout duration and the number
of events recorded before expiry.
Implementations§
Source§impl Error
impl Error
Sourcepub fn external(e: impl Error + Send + Sync + 'static) -> Self
pub fn external(e: impl Error + Send + Sync + 'static) -> Self
Wrap an application-level error into Error::External.
Use this in Actor::handle_event or
Actor::on_error to propagate domain errors
through the Maiko error type.