summaryrefslogtreecommitdiffstats
path: root/src/api/error.rs
diff options
context:
space:
mode:
authorToby Vincent <tobyv@tobyvin.dev>2024-05-07 19:04:46 -0500
committerToby Vincent <tobyv@tobyvin.dev>2024-05-07 19:04:46 -0500
commit82cc3b8054f4b126b422d946ea694d282a41cd78 (patch)
tree13052c98b2f4809ac3b9bc66156c536bfdc135c3 /src/api/error.rs
parente56a04b88dfb8c141310a71d1a9c6b4be2fc9203 (diff)
feat(api): return user resource in location header
Diffstat (limited to 'src/api/error.rs')
-rw-r--r--src/api/error.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/api/error.rs b/src/api/error.rs
index 10b5468..bc75d41 100644
--- a/src/api/error.rs
+++ b/src/api/error.rs
@@ -18,6 +18,9 @@ pub enum Error {
#[error("Failed to parse header: {0} (wrong token type?)")]
Header(axum_extra::typed_header::TypedHeaderRejection),
+ #[error("Failed to parse header: {0}")]
+ HeaderValue(#[from] axum::http::header::InvalidHeaderValue),
+
#[error("Invalid user token")]
InvalidToken,
@@ -72,6 +75,7 @@ impl axum::response::IntoResponse for Error {
Self::HeaderNotFound(_) => StatusCode::BAD_REQUEST,
Self::EmailInvalid(_) | Self::Header(_) => StatusCode::UNPROCESSABLE_ENTITY,
Self::AuthRequest(_) | Self::Sqlx(_) => StatusCode::INTERNAL_SERVER_ERROR,
+ Self::HeaderValue(_) => StatusCode::INTERNAL_SERVER_ERROR,
Self::Auth(err) => return err.into_response(),
};