pub enum ExecutorError<E>where
E: Display,{
TaskFailed(E),
PrepareFailed(String),
PrepareCommitFailed(String),
PrepareRollbackFailed {
original: String,
rollback: String,
},
LockPoisoned(String),
}Expand description
Executor error types
Defines various error conditions that can occur during executor operation, including task execution errors, prepare failures, prepare commit failures, and prepare rollback failures.
§Type Parameters
E- The original error type from task execution
§Examples
use qubit_lock::double_checked::ExecutorError;
let error: ExecutorError<String> =
ExecutorError::TaskFailed("task failed".to_string());
println!("Error: {}", error);
let error_with_msg: ExecutorError<String> =
ExecutorError::PrepareFailed("Service is not running".to_string());
println!("Error: {}", error_with_msg);§Author
Haixing Hu
Variants§
TaskFailed(E)
Task execution failed with original error
PrepareFailed(String)
Preparation action failed
PrepareCommitFailed(String)
Commit action for a successfully completed prepare action failed.
PrepareRollbackFailed
Rollback action for a successfully completed prepare action failed.
Fields
LockPoisoned(String)
Lock poisoned error
Trait Implementations§
Source§impl<E> Debug for ExecutorError<E>
impl<E> 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>
impl<E> Error for ExecutorError<E>
1.30.0 · 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()
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