use thiserror::Error;

#[cfg(feature = "server")]
#[derive(Error, Debug)]
pub enum Error {
    #[error("Database error: {0}")]
    SurrealDb(#[from] surrealdb::Error),

    #[error("No document returned")]
    NoDocument,

    #[error("Invalid header value")]
    InvalidHeaderValue(#[from] axum::http::header::InvalidHeaderValue),

    #[error("Could not create timestamp")]
    ComponentRange(#[from] time::error::ComponentRange),

    #[error("No session cookie set")]
    NoSessionCookie,

    #[error("Could not get cookie jar")]
    CookieJar(String),
}
