aboutsummaryrefslogtreecommitdiffstats
path: root/lib/api-config/src/error.rs
blob: a6c4991b2a6973d77f162d0732269fb471f6f6b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use thiserror::Error;

#[derive(Error, Debug)]
pub enum ConfigurationError {
    #[error(transparent)]
    Database(#[from] sqlx::Error),
    #[error("the data for key `{0}` is not available")]
    Redaction(String),
    #[error("invalid header (expected {expected:?}, found {found:?})")]
    InvalidHeader { expected: String, found: String },
    #[error("unknown data store error")]
    Unknown,
    #[error(transparent)]
    Pagination(#[from] base64::DecodeError),
    #[error(transparent)]
    PaginationCursor(#[from] std::string::FromUtf8Error),
    #[error(transparent)]
    PaginationId(#[from] std::num::ParseIntError),
}