From e55565cb3841bf17cf7b8a5e5cf84e59e4372e11 Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Wed, 9 Oct 2024 22:52:42 -0400 Subject: Normalize `not found` errors a bit. --- src/message/routes.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/message/routes.rs') diff --git a/src/message/routes.rs b/src/message/routes.rs index 29fe3d7..e21c674 100644 --- a/src/message/routes.rs +++ b/src/message/routes.rs @@ -9,7 +9,7 @@ use axum::{ use crate::{ app::App, clock::RequestedAt, - error::Internal, + error::{Internal, NotFound}, login::Login, message::{self, app::DeleteError}, }; @@ -38,7 +38,7 @@ impl IntoResponse for ErrorResponse { let Self(error) = self; match error { not_found @ (DeleteError::ChannelNotFound(_) | DeleteError::NotFound(_)) => { - (StatusCode::NOT_FOUND, not_found.to_string()).into_response() + NotFound(not_found).into_response() } other => Internal::from(other).into_response(), } -- cgit v1.2.3