Skip to main content

apalis_sqlite/
error.rs

1use super::SqlxError;
2use apalis_core::task::{status::StatusError, task_id::TaskIdError};
3/// Represents a wrapper for errors encountered on this crate
4#[derive(Debug, thiserror::Error)]
5pub enum Error {
6    /// Inner engine error
7    #[error(transparent)]
8    Database(#[from] SqlxError),
9    /// Error handling json
10    #[error("JsonError: {0}")]
11    JsonError(serde_json::Error),
12    /// Reenqueue Mismatch error
13    #[error("ReenqueueMismatch: Queued [{queued}] , Abandoned[{abandoned}] ")]
14    ReenqueueMismatch {
15        /// The db count
16        queued: usize,
17        /// The workers count
18        abandoned: usize,
19    },
20    /// Error decoding the task_id
21    #[error("TaskIdError: {0}")]
22    TaskIdError(TaskIdError),
23    /// Error decoding the task status
24    #[error("StatusError: {0}")]
25    StatusError(StatusError),
26}