Skip to main content

rustium_core/
error.rs

1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum Error {
5    #[error("configuration error: {0}")]
6    Configuration(String),
7    #[error("source error: {0}")]
8    Source(String),
9    #[error("retryable source error: {0}")]
10    RetryableSource(String),
11    #[error("encoding error: {0}")]
12    Encoding(String),
13    #[error("sink error: {0}")]
14    Sink(String),
15    #[error("retryable sink error: {0}")]
16    RetryableSink(String),
17    #[error("state error: {0}")]
18    State(String),
19    #[error("runtime invariant violated: {0}")]
20    Invariant(String),
21    #[error("connector cancelled")]
22    Cancelled,
23    #[error(transparent)]
24    Json(#[from] serde_json::Error),
25    #[error(transparent)]
26    Io(#[from] std::io::Error),
27}
28
29pub type Result<T, E = Error> = std::result::Result<T, E>;