aboutsummaryrefslogtreecommitdiffstats
path: root/src/renderer.rs
diff options
context:
space:
mode:
authorboastful-squirrel <boastful.squirrel@gmail.com>2019-05-01 16:23:29 +0000
committerboastful-squirrel <boastful.squirrel@gmail.com>2019-05-01 16:23:29 +0000
commitfa0c2865366b1bb65a2977c4b9608c9a92fc5889 (patch)
treeefdaab480316866824abbf7557458cb877db2993 /src/renderer.rs
parentFix return link when random_route is set (diff)
downloadminiserve-fa0c2865366b1bb65a2977c4b9608c9a92fc5889.tar.gz
miniserve-fa0c2865366b1bb65a2977c4b9608c9a92fc5889.zip
Use HTTP StatusCode for error title
Diffstat (limited to 'src/renderer.rs')
-rw-r--r--src/renderer.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/renderer.rs b/src/renderer.rs
index 03c46d8..acef208 100644
--- a/src/renderer.rs
+++ b/src/renderer.rs
@@ -1,3 +1,4 @@
+use actix_web::http::StatusCode;
use chrono::{DateTime, Duration, Utc};
use chrono_humanize::{Accuracy, HumanTime, Tense};
use maud::{html, Markup, PreEscaped, DOCTYPE};
@@ -846,6 +847,7 @@ fn humanize_systemtime(src_time: Option<SystemTime>) -> Option<String> {
/// Renders an error on the webpage
pub fn render_error(
error_description: &str,
+ error_code: StatusCode,
return_address: &str,
sort_method: Option<SortingMethod>,
sort_order: Option<SortingOrder>,
@@ -867,9 +869,9 @@ pub fn render_error(
html! {
body {
- (page_header("Error", color_scheme, false, true))
+ (page_header(&error_code.to_string(), color_scheme, false, true))
div.error {
- p { "Error" }
+ p { (error_code.to_string()) }
@for error in error_description.lines() {
p { (error) }
}