Skip to main content

linkrs_sync/batch/
error.rs

1use thiserror::Error;
2
3#[cfg(feature = "fulltext")]
4use crate::coordinator::CoordinatorError;
5#[cfg(feature = "fulltext")]
6use linkrs_fulltext::SearchError;
7
8#[derive(Debug, Error)]
9pub enum BatchError {
10    #[error("Buffer overflow: {0}")]
11    BufferOverflow(String),
12
13    #[error("Queue is full")]
14    QueueFull,
15
16    #[error("Queue is closed")]
17    QueueClosed,
18
19    #[cfg(feature = "fulltext")]
20    #[error("Coordinator error: {0}")]
21    CoordinatorError(#[from] CoordinatorError),
22
23    #[error("Commit error: {0}")]
24    CommitError(String),
25
26    #[error("Internal error: {0}")]
27    Internal(String),
28
29    #[error("Transaction error: {0}")]
30    TransactionError(String),
31
32    #[error("Invalid operation: {0}")]
33    InvalidOperation(String),
34
35    #[cfg(feature = "fulltext")]
36    #[error("Search engine error: {0}")]
37    SearchError(#[from] SearchError),
38}
39
40pub type BatchResult<T> = Result<T, BatchError>;