From 301919d9d4d6a9424783a79671a6d2168559cf7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa?= Date: Fri, 21 Dec 2018 22:27:35 +0100 Subject: [PATCH] Modified navigation bar and corrected some comments --- src/error.rs | 7 +++---- src/static/admin.html | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/error.rs b/src/error.rs index a42cccb..7f058b8 100644 --- a/src/error.rs +++ b/src/error.rs @@ -24,7 +24,7 @@ macro_rules! make_error { $struct::$name(e, _) => $struct::$name(e, msg.into()), )+} } - // First value is log message, second is user message + // Prints the log message and returns the user message pub fn display_error(self) -> String { match &self {$( $struct::$name(e, s) => { @@ -32,7 +32,7 @@ macro_rules! make_error { error!("{}", log_msg); if $show_cause { - error!("[CAUSE] {:?}", e); + error!("[CAUSE] {:#?}", e); } $usr_msg_fun(e, s) @@ -40,7 +40,6 @@ macro_rules! make_error { )+} } } - }; } @@ -124,7 +123,7 @@ use rocket::response::{self, Responder, Response}; impl<'r> Responder<'r> for Error { fn respond_to(self, _: &Request) -> response::Result<'r> { - // TODO: We could put the security headers here + // TODO: We could put the security headers here, but it would only apply to the errors let usr_msg = self.display_error(); diff --git a/src/static/admin.html b/src/static/admin.html index 0753da9..1af6ca5 100644 --- a/src/static/admin.html +++ b/src/static/admin.html @@ -127,14 +127,14 @@