#[non_exhaustive]pub enum Error {
Show 16 variants
Database {
operation: Cow<'static, str>,
source: Error,
},
Pool(PoolError),
Blocking(BoxDynError),
Migration(BoxDynError),
Row(BoxDynError),
InvalidArgument(String),
IdempotencyConflict {
job_type: String,
conflicting_keys: Vec<String>,
total: usize,
},
Decode(BoxDynError),
Json(Error),
MissingField(&'static str),
AlreadyRegistered(String),
TaskNotFound {
operation: Cow<'static, str>,
task_id: String,
queue: String,
hint: &'static str,
},
StaleAcknowledgement {
task_id: String,
queue: String,
worker_id: String,
},
WorkerNotRegistered {
operation: Cow<'static, str>,
worker_id: String,
queue: String,
hint: &'static str,
},
NotifyListener(String),
SinkBufferFull(usize),
}Expand description
Error type returned by the Diesel PostgreSQL backend.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Database
Diesel query failed while running a named backend operation.
Fields
Pool(PoolError)
Acquiring a pooled connection failed.
Blocking(BoxDynError)
A blocking runtime task failed to complete.
Migration(BoxDynError)
Database migrations failed.
Row(BoxDynError)
A task row could not be converted into an Apalis task.
InvalidArgument(String)
A caller-supplied argument was out of range for the backend.
IdempotencyConflict
One or more tasks in an enqueue batch collided with the
(job_type, idempotency_key) unique constraint.
The whole batch is rolled back, not only the colliding rows: the
duplicates are dropped by ON CONFLICT DO NOTHING, then the post-insert
check rolls the batch’s SAVEPOINT back, so every task in the batch is
undone — including the non-conflicting ones. A surrounding (outer)
transaction stays alive, so the caller can decide whether to commit the
rest of its work or roll back. conflicting_keys lists exactly which
idempotency_keys collided, so a batch caller can drop them and
re-enqueue the rest. Match this variant instead of the
Error::InvalidArgument message text to tell a benign duplicate apart
from a real failure.
Fields
Decode(BoxDynError)
A task payload or task result could not be decoded.
Json(Error)
JSON encoding or decoding failed.
MissingField(&'static str)
A required task field was missing.
AlreadyRegistered(String)
A worker or queue registration already exists.
TaskNotFound
A task could not be locked because it was absent or not currently lockable.
Fields
StaleAcknowledgement
A task acknowledgement no longer matches the stored lock state.
Fields
WorkerNotRegistered
A worker heartbeat could not be recorded because the worker row is absent.
Fields
NotifyListener(String)
PostgreSQL notification listener failed.
SinkBufferFull(usize)
A sink producer attempted to send without observing backpressure.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl !UnwindSafe for Error
Blanket Implementations§
Source§impl<T> AggregateExpressionMethods for T
impl<T> AggregateExpressionMethods for T
Source§fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
DISTINCT modifier for aggregate functions Read moreSource§fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
ALL modifier for aggregate functions Read moreSource§fn aggregate_filter<P>(self, f: P) -> Self::Output
fn aggregate_filter<P>(self, f: P) -> Self::Output
Source§fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
&self to an expression for Diesel’s query builder. Read more