pub enum SystemError {
Rejected(String),
InfiniteLoop {
actor_id: String,
event_type: String,
max_iterations: usize,
states: Vec<Value>,
},
MaxSteps,
Failed(String),
}Expand description
An error raised by a system call. As in XState, the system must not be
used after an error other than SystemError::Rejected: state may be
partially updated.
Variants§
Rejected(String)
The call was rejected before changing anything (an unknown actor, a stale effect result, time moving backwards, …).
InfiniteLoop
A machine exceeded its microstep bound (XState’s
InfiniteTransitionError): the actor’s id, the event, the bound and
the last state values, oldest first.
MaxSteps
More than max_steps messages, timers or allocations in one call.
Failed(String)
Any other failure while transitioning.
Implementations§
Source§impl SystemError
impl SystemError
Sourcepub fn to_value(&self) -> Value
pub fn to_value(&self) -> Value
The error as XState persists the Error it throws:
{ "@error": name, "message" } (InfiniteTransitionError for an
infinite loop, Error otherwise).
Sourcepub fn is_execution_error(&self) -> bool
pub fn is_execution_error(&self) -> bool
Whether this is an exception of the actor’s own logic (XState’s
execution error), which a live actor recovers from through onError
or reports to its parent; not a fault of the call or the system.
Trait Implementations§
Source§impl Clone for SystemError
impl Clone for SystemError
Source§impl Debug for SystemError
impl Debug for SystemError
Source§impl Display for SystemError
impl Display for SystemError
Source§impl Error for SystemError
impl Error for SystemError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()