use super::utility::InvalidUriParts;
use axum::{
http::{StatusCode, uri::InvalidUri},
response::{IntoResponse, Response},
};
use thiserror::Error as ThisError;
use tower_sessions::session::Error as SessionError;
#[derive(Debug, ThisError)]
#[non_exhaustive]
pub enum AuthError {
#[error("Session error: {0}")]
SessionError(#[from] SessionError),
#[error("URL error: {0}")]
UrlError(#[from] InvalidUri),
#[error("URL error: {0}")]
UrlPartsError(#[from] InvalidUriParts),
}
impl IntoResponse for AuthError {
fn into_response(self) -> Response {
(
StatusCode::INTERNAL_SERVER_ERROR,
self.to_string(),
).into_response()
}
}