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

#[derive(Error, Debug)]
pub enum WardenError {
    #[error(transparent)]
    Datastore(#[from] sqlx::Error),
    #[error(transparent)]
    Migration(#[from] sqlx::migrate::MigrateError),
    #[error(transparent)]
    Url(#[from] url::ParseError),
    #[error(transparent)]
    Pagination(#[from] base64::DecodeError),
    #[error(transparent)]
    PaginationCursor(#[from] std::string::FromUtf8Error),
    #[error("Missing required configuration values:\n`{0}`")]
    Config(String),
    #[error("invalid header (expected {expected:?}, found {found:?})")]
    InvalidHeader { expected: String, found: String },
    #[error("unknown data store error")]
    Unknown,
}