Skip to main content

a3s_effect/
error.rs

1use thiserror::Error;
2
3/// Expected failures of the actor runtime. Defects use [`crate::Exit::Die`].
4#[derive(Debug, Error, Clone, PartialEq, Eq)]
5pub enum ActorError {
6    #[error("fact log is busy in another instance")]
7    LogBusy,
8    #[error("fact key {key} was reused with a different payload")]
9    DuplicateFact { key: String },
10    #[error("two components enabled transition {key}")]
11    DuplicateTransition { key: String },
12    #[error("settled after {limit} transitions without becoming quiescent")]
13    StepLimit { limit: u32 },
14    #[error("thread id {thread_id:?} is not a single path segment")]
15    BadThreadId { thread_id: String },
16    #[error("fact schema: {0}")]
17    Schema(String),
18    #[error("config: {0}")]
19    Config(String),
20    /// A defect. The coding fold does not retry it and does not append a fact.
21    #[error("{0}")]
22    Defect(String),
23    #[error("transition {key} failed: {message}")]
24    Handler { key: String, message: String },
25}