aboutsummaryrefslogtreecommitdiff
path: root/src/error/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/error/mod.rs')
-rw-r--r--src/error/mod.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/error/mod.rs b/src/error/mod.rs
index 4b8e1c4..07db26f 100644
--- a/src/error/mod.rs
+++ b/src/error/mod.rs
@@ -5,7 +5,7 @@ pub use client::ClientError;
5pub use server::ServerError; 5pub use server::ServerError;
6 6
7use argon2::password_hash::Error as PasswordHashError; 7use argon2::password_hash::Error as PasswordHashError;
8use axum::extract::rejection::JsonRejection; 8use axum::extract::rejection::{JsonRejection, QueryRejection};
9use axum_extra::typed_header::TypedHeaderRejection; 9use axum_extra::typed_header::TypedHeaderRejection;
10use sea_orm::DbErr; 10use sea_orm::DbErr;
11 11
@@ -34,6 +34,12 @@ impl From<JsonRejection> for ApiError {
34 } 34 }
35} 35}
36 36
37impl From<QueryRejection> for ApiError {
38 fn from(value: QueryRejection) -> Self {
39 ClientError::BadJsonBody(value.body_text()).into()
40 }
41}
42
37impl From<TypedHeaderRejection> for ApiError { 43impl From<TypedHeaderRejection> for ApiError {
38 fn from(value: TypedHeaderRejection) -> Self { 44 fn from(value: TypedHeaderRejection) -> Self {
39 ClientError::BadAuthTokenHeader(value.to_string()).into() 45 ClientError::BadAuthTokenHeader(value.to_string()).into()