pub enum ExecutorError<E> {
TaskFailed(E),
Panic(CallbackError),
PrepareFailed(CallbackError),
PrepareCommitFailed(CallbackError),
PrepareRollbackFailed {
original: CallbackError,
rollback: CallbackError,
},
}Expand description
Executor error types.
§Type Parameters
E- The original error type from task execution
§Examples
use qubit_dcl::double_checked::ExecutorError;
use qubit_dcl::double_checked::CallbackError;
let error: ExecutorError<String> =
ExecutorError::TaskFailed("task failed".to_string());
println!("Error: {}", error);
let error_with_msg: ExecutorError<String> =
ExecutorError::PrepareFailed(CallbackError::from_display("Service is not running"));
println!("Error: {}", error_with_msg);Variants§
TaskFailed(E)
Task execution failed with original error
Panic(CallbackError)
Task execution panicked.
PrepareFailed(CallbackError)
Preparation action failed
PrepareCommitFailed(CallbackError)
Commit action for a successfully completed prepare action failed.
PrepareRollbackFailed
Rollback action for a successfully completed prepare action failed.
Fields
original: CallbackErrorThe original error that triggered the rollback
rollback: CallbackErrorThe error that occurred during prepare rollback
Implementations§
Source§impl<E> ExecutorError<E>
impl<E> ExecutorError<E>
Sourcepub fn callback_type(&self) -> Option<&'static str>
pub fn callback_type(&self) -> Option<&'static str>
Returns the callback type label, when the error comes from a callback and the type is available.
This returns None for task failures and callback errors without
associated type labels.
§Returns
Some(label) for callback failures that carry callback type metadata,
or None for task failures and untyped callback failures.
Trait Implementations§
Source§impl<E: Debug> Debug for ExecutorError<E>
impl<E: Debug> Debug for ExecutorError<E>
Source§impl<E> Display for ExecutorError<E>where
E: Display,
impl<E> Display for ExecutorError<E>where
E: Display,
Source§impl<E> Error for ExecutorError<E>where
E: Error + 'static,
impl<E> Error for ExecutorError<E>where
E: Error + 'static,
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the underlying task error as the standard error source.
Prepare lifecycle failures store their messages as strings and therefore do not expose a structured source error.
§Returns
Some(error) for ExecutorError::TaskFailed, or None for panic and
prepare lifecycle failures.
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()