40 lines
737 B
Rust
40 lines
737 B
Rust
use axum::response::IntoResponse;
|
|
|
|
use crate::error::AppError;
|
|
|
|
mod auth;
|
|
mod form;
|
|
mod json;
|
|
mod path;
|
|
mod query;
|
|
|
|
pub use auth::*;
|
|
pub use form::*;
|
|
pub use json::*;
|
|
pub use path::*;
|
|
pub use query::*;
|
|
|
|
#[derive(Debug, thiserror::Error)]
|
|
pub enum ExtractorError {
|
|
#[error(transparent)]
|
|
Authorization(#[from] auth::AuthError),
|
|
|
|
#[error(transparent)]
|
|
Form(#[from] form::FormError),
|
|
|
|
#[error(transparent)]
|
|
Json(#[from] json::JsonError),
|
|
|
|
#[error(transparent)]
|
|
Path(#[from] path::PathError),
|
|
|
|
#[error(transparent)]
|
|
Query(#[from] query::QueryError),
|
|
}
|
|
|
|
impl IntoResponse for ExtractorError {
|
|
fn into_response(self) -> axum::response::Response {
|
|
AppError::from(self).into_response()
|
|
}
|
|
}
|