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.
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.
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl<E> Freeze for ExecutorError<E>where
E: Freeze,
impl<E> RefUnwindSafe for ExecutorError<E>where
E: RefUnwindSafe,
impl<E> Send for ExecutorError<E>where
E: Send,
impl<E> Sync for ExecutorError<E>where
E: Sync,
impl<E> Unpin for ExecutorError<E>where
E: Unpin,
impl<E> UnsafeUnpin for ExecutorError<E>where
E: UnsafeUnpin,
impl<E> UnwindSafe for ExecutorError<E>where
E: UnwindSafe,
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