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 key {key} was reused with a different payload")]
7    DuplicateFact { key: String },
8    #[error("two components enabled transition {key}")]
9    DuplicateTransition { key: String },
10    #[error("settled after {limit} transitions without becoming quiescent")]
11    StepLimit { limit: u32 },
12    #[error("thread id {thread_id:?} is not a single path segment")]
13    BadThreadId { thread_id: String },
14    #[error("fact schema: {0}")]
15    Schema(String),
16    #[error("config: {0}")]
17    Config(String),
18    /// A defect. The coding fold does not retry it and does not append a fact.
19    #[error("{0}")]
20    Defect(String),
21    #[error("transition {key} failed: {message}")]
22    Handler { key: String, message: String },
23}