From b4a9b8de4500889c7f6a2004f5a801b6f039fe83 Mon Sep 17 00:00:00 2001 From: dfayd0 <78728332+dfayd0@users.noreply.github.com> Date: Fri, 10 Oct 2025 16:24:59 +0200 Subject: [PATCH] feat(market-server-rust): enhance error page to display status code and improved message --- servers/rust-server/src/error.rs | 3 ++- servers/rust-server/templates/error.html | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/servers/rust-server/src/error.rs b/servers/rust-server/src/error.rs index 793e2d3..5dc025c 100644 --- a/servers/rust-server/src/error.rs +++ b/servers/rust-server/src/error.rs @@ -55,6 +55,7 @@ impl IntoResponse for AppError { #[template(path = "error.html")] struct Tmpl { error: String, + status: StatusCode, } let status = match &self { @@ -73,7 +74,7 @@ impl IntoResponse for AppError { }, AppError::DatabaseError(_) => StatusCode::INTERNAL_SERVER_ERROR, }; - let tmpl = Tmpl { error: self.to_string() }; + let tmpl = Tmpl { error: self.to_string(), status }; if let Ok(body) = tmpl.render() { (status, Html(body)).into_response() } else { diff --git a/servers/rust-server/templates/error.html b/servers/rust-server/templates/error.html index 31e0330..46e4dd7 100644 --- a/servers/rust-server/templates/error.html +++ b/servers/rust-server/templates/error.html @@ -1 +1,8 @@ -