21 lines
505 B
Rust

use std::fmt::Display;
#[derive(Debug)]
pub enum AuthError {
NoPermssions,
InvalidToken,
Unexpected,
}
impl Display for AuthError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::NoPermssions => write!(f, "{}", "No permissions"),
Self::InvalidToken => write!(f, "{}", "Invalid token"),
Self::Unexpected => write!(f, "{}", "Unexpected error"),
}
}
}
impl std::error::Error for AuthError {}