use soph_core::{traits::ErrorTrait, AnyError};
use thiserror::Error;

#[derive(Error, Debug)]
pub enum Error {
    #[error(transparent)]
    Any(#[from] AnyError),

    #[error("{0}")]
    Message(String),

    #[error(transparent)]
    JsonWebToken(#[from] jsonwebtoken::errors::Error),

    #[error("{0}")]
    Unauthorized(String),
}

impl ErrorTrait for Error {}
