pub enum SupervisorError {
Show 13 variants
ConfigurationError {
task_id: String,
reason: String,
},
DependencyValidation {
task_id: String,
dependency_id: String,
error: ValidationError,
},
CircularDependency {
task_a: String,
task_b: String,
},
PrerequisiteFailed {
name: String,
source: Box<dyn Error + Send + Sync>,
},
UnknownTask(String),
PersistenceError {
message: String,
source: Error,
},
SerializationError(Error),
TaskPanicked {
task_id: String,
source: JoinError,
},
ChannelError(String),
Timeout(String),
CoordinationError(String),
Internal(String),
Infrastructure {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
}Expand description
Error types for the foxtive-supervisor crate.
Variants§
ConfigurationError
DependencyValidation
CircularDependency
PrerequisiteFailed
UnknownTask(String)
PersistenceError
SerializationError(Error)
TaskPanicked
ChannelError(String)
Timeout(String)
CoordinationError(String)
Internal(String)
Infrastructure
Wraps infrastructure errors (DB, Redis, IO, serialization, etc.) Carries source for error chaining.
Implementations§
Source§impl SupervisorError
impl SupervisorError
pub fn config(task_id: impl Into<String>, reason: impl Into<String>) -> Self
pub fn dependency_validation( task_id: &str, dependency_id: &str, error: ValidationError, ) -> Self
pub fn circular_dependency(task_a: &str, task_b: &str) -> Self
pub fn prerequisite_failed( name: &str, source: Box<dyn Error + Send + Sync>, ) -> Self
pub fn unknown_task(id: &str) -> Self
pub fn persistence(message: impl Into<String>, source: Error) -> Self
pub fn task_panicked(task_id: impl Into<String>, source: JoinError) -> Self
pub fn channel(message: impl Into<String>) -> Self
pub fn timeout(message: impl Into<String>) -> Self
pub fn coordination(message: impl Into<String>) -> Self
pub fn internal(message: impl Into<String>) -> Self
Sourcepub fn wrap(e: impl Error + Send + Sync + 'static) -> Self
pub fn wrap(e: impl Error + Send + Sync + 'static) -> Self
Wraps any error into an Infrastructure SupervisorError.
This is the catch-all constructor for error types that don’t have
a dedicated From impl. Use with .map_err():
use foxtive_supervisor::error::{SupervisorError, SupervisorResult};
fn example() -> SupervisorResult<()> {
let flag = "true".parse::<bool>().map_err(SupervisorError::wrap)?;
Ok(())
}Trait Implementations§
Source§impl Debug for SupervisorError
impl Debug for SupervisorError
Source§impl Display for SupervisorError
impl Display for SupervisorError
Source§impl Error for SupervisorError
impl Error for SupervisorError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<&str> for SupervisorError
impl From<&str> for SupervisorError
Source§impl From<Error> for SupervisorError
impl From<Error> for SupervisorError
Source§impl From<Error> for SupervisorError
impl From<Error> for SupervisorError
Source§impl From<JoinError> for SupervisorError
impl From<JoinError> for SupervisorError
Auto Trait Implementations§
impl !RefUnwindSafe for SupervisorError
impl !UnwindSafe for SupervisorError
impl Freeze for SupervisorError
impl Send for SupervisorError
impl Sync for SupervisorError
impl Unpin for SupervisorError
impl UnsafeUnpin for SupervisorError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more