use std::fmt::Formatter;
#[derive(Debug)]
pub enum RTokenError {
MutexPoisoned,
}
impl std::fmt::Display for RTokenError {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
match self {
RTokenError::MutexPoisoned => write!(f, "Token manager mutex poisoned"),
}
}
}
impl std::error::Error for RTokenError {}
#[cfg(feature = "actix")]
impl actix_web::ResponseError for RTokenError {}
#[cfg(feature = "axum")]
impl ::axum::response::IntoResponse for RTokenError {
fn into_response(self) -> ::axum::response::Response {
(
::axum::http::StatusCode::INTERNAL_SERVER_ERROR,
self.to_string(),
)
.into_response()
}
}