pub enum HandlerError {
Benign(ComponentFault),
Recoverable(ComponentFault),
Unrecoverable(ComponentFault),
}Expand description
An abnormal result returned from a component handler.
Kompact does not classify application errors automatically. Users should convert their own error types into the variant that matches the intended runtime behaviour.
Variants§
Benign(ComponentFault)
The handler observed an abnormal condition, but the component remains healthy.
Benign errors are logged and normal processing continues.
Recoverable(ComponentFault)
The component instance is faulty, but supervision may attempt recovery.
Recoverable errors mark the component as faulty and pass a FaultContext to the component’s recovery function. Top-level components without supervision poison the system.
Unrecoverable(ComponentFault)
The component instance is faulty and terminal.
Unrecoverable errors destroy the component without running recovery. Top-level components poison the system.
Implementations§
Source§impl HandlerError
impl HandlerError
Sourcepub fn benign<E>(error: E) -> HandlerError
pub fn benign<E>(error: E) -> HandlerError
Construct a benign handler error.
Sourcepub fn recoverable<E>(error: E) -> HandlerError
pub fn recoverable<E>(error: E) -> HandlerError
Construct a recoverable handler error.
Sourcepub fn unrecoverable<E>(error: E) -> HandlerError
pub fn unrecoverable<E>(error: E) -> HandlerError
Construct an unrecoverable handler error.
Sourcepub fn benign_boxed(error: Box<dyn Error + Send>) -> HandlerError
pub fn benign_boxed(error: Box<dyn Error + Send>) -> HandlerError
Construct a benign handler error from an already boxed error.
Sourcepub fn recoverable_boxed(error: Box<dyn Error + Send>) -> HandlerError
pub fn recoverable_boxed(error: Box<dyn Error + Send>) -> HandlerError
Construct a recoverable handler error from an already boxed error.
Sourcepub fn unrecoverable_boxed(error: Box<dyn Error + Send>) -> HandlerError
pub fn unrecoverable_boxed(error: Box<dyn Error + Send>) -> HandlerError
Construct an unrecoverable handler error from an already boxed error.
Trait Implementations§
Source§impl Debug for HandlerError
impl Debug for HandlerError
Source§impl Display for HandlerError
impl Display for HandlerError
Source§impl Error for HandlerError
impl Error for HandlerError
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()