From 3dd25b2063832ef77765857ff24005ee03525049 Mon Sep 17 00:00:00 2001 From: Joe Ardent Date: Fri, 29 Aug 2025 11:10:42 -0700 Subject: [PATCH] make sure everything is wendered --- src/signup/mod.rs | 15 +++++---------- src/watches/handlers.rs | 10 +++------- src/watches/mod.rs | 2 -- 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/src/signup/mod.rs b/src/signup/mod.rs index e8e6e26..ef694f2 100644 --- a/src/signup/mod.rs +++ b/src/signup/mod.rs @@ -6,13 +6,14 @@ use http::StatusCode; use julid::Julid; use serde::{Deserialize, Serialize}; use sqlx::SqlitePool; -use templates::{SignupErrorPage, SignupPage}; -use crate::{WatchDate, WatchError}; +use crate::{WatchDate, Wender}; pub mod handlers; pub mod templates; +use templates::SignupErrorPage; + //-************************************************************************ // Error types for user creation //-************************************************************************ @@ -178,10 +179,7 @@ impl IntoResponse for CreateInviteError { StatusCode::OK, SignupErrorPage("Sorry, invitations require an owner".to_string()) .render() - .map_err(|e| { - tracing::error!("could not render create user error page, got {e}"); - StatusCode::INTERNAL_SERVER_ERROR - }), + .wender(), ) .into_response(), _ => (StatusCode::OK, format!("{self}")).into_response(), @@ -199,10 +197,7 @@ impl IntoResponse for CreateUserError { StatusCode::OK, SignupErrorPage("Sorry, that invitation isn't valid.".to_string()) .render() - .map_err(|e| { - tracing::error!("could not render create user error page, got {e}"); - StatusCode::INTERNAL_SERVER_ERROR - }), + .wender(), ) .into_response(), _ => (StatusCode::OK, format!("{self}")).into_response(), diff --git a/src/watches/handlers.rs b/src/watches/handlers.rs index 637d817..f57ae66 100644 --- a/src/watches/handlers.rs +++ b/src/watches/handlers.rs @@ -1,7 +1,6 @@ use askama::Template; use axum::{ extract::{Form, Path, State}, - http::StatusCode, response::{IntoResponse, Redirect}, }; use http::HeaderValue; @@ -14,8 +13,8 @@ use super::{ AddError, AddErrorKind, EditError, EditErrorKind, WatchesError, }; use crate::{ - misc_util::empty_string_as_none, AuthSession, MyWatchesPage, ShowKind, Watch, WatchError, - WatchQuest, Wender, + misc_util::empty_string_as_none, AuthSession, MyWatchesPage, ShowKind, Watch, WatchQuest, + Wender, }; //-************************************************************************ @@ -286,10 +285,7 @@ pub async fn get_watch( user: auth.user, } .render() - .map_err(|e| { - tracing::error!("could not render watch page, got {e}"); - StatusCode::INTERNAL_SERVER_ERROR - }) + .wender() .into_response() } diff --git a/src/watches/mod.rs b/src/watches/mod.rs index 8480b73..9f60239 100644 --- a/src/watches/mod.rs +++ b/src/watches/mod.rs @@ -3,8 +3,6 @@ use http::StatusCode; use julid::Julid; use serde::{Deserialize, Serialize}; -use crate::WatchError; - pub mod handlers; pub mod templates;