Skip to main content

astra_core/
errors.rs

1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum StoreError {
5    #[error("invalid argument: {0}")]
6    InvalidArgument(String),
7
8    #[error("required revision has been compacted (compact_revision={0})")]
9    Compacted(i64),
10
11    #[error("resource exhausted: {0}")]
12    ResourceExhausted(String),
13
14    #[error("key not found")]
15    KeyNotFound,
16
17    #[error("io error: {0}")]
18    Io(#[from] std::io::Error),
19
20    #[error("serde error: {0}")]
21    Serde(#[from] serde_json::Error),
22
23    #[error("internal error: {0}")]
24    Internal(String),
25}
26
27#[derive(Debug, Error)]
28pub enum TieringError {
29    #[error("aws sdk error: {0}")]
30    AwsSdk(String),
31
32    #[error("checksum mismatch")]
33    ChecksumMismatch,
34
35    #[error("store error: {0}")]
36    Store(#[from] StoreError),
37
38    #[error("io error: {0}")]
39    Io(#[from] std::io::Error),
40}