From 3615e5982c7c70ecb3f181d683354085bb2b9953 Mon Sep 17 00:00:00 2001 From: Sam Rijs Date: Sun, 11 Feb 2018 17:59:19 +1100 Subject: [PATCH] improve error page --- src/server/mod.rs | 3 ++- src/server/views/html/error.rs | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/server/mod.rs b/src/server/mod.rs index 87bd300..c21011e 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -121,7 +121,8 @@ impl Server { match repo_path_result { Err(err) => { error!(logger, "error: {}", err); - let mut response = views::html::error::render("Could not parse repository URL", ""); + let mut response = views::html::error::render("Could not parse repository path", + "Please make sure to provide a valid repository path."); response.set_status(StatusCode::BadRequest); future::Either::A(future::ok(response)) }, diff --git a/src/server/views/html/error.rs b/src/server/views/html/error.rs index 920788a..c4753c4 100644 --- a/src/server/views/html/error.rs +++ b/src/server/views/html/error.rs @@ -5,9 +5,11 @@ pub fn render(title: &str, descr: &str) -> Response { super::render_html(title, html! { section class="hero is-light" { div class="hero-head" (super::render_navbar()) - div class="hero-body" { - div class="container" { - p class="title is-1" (title) + } + section class="section" { + div class="container" { + div class="notification is-danger" { + p class="title is-3" (title) p (descr) } }