aboutsummaryrefslogtreecommitdiff
path: root/src/error.rs
diff options
context:
space:
mode:
authorjanost <[email protected]>2020-11-21 23:12:25 +0100
committerjanost <[email protected]>2020-11-22 00:09:45 +0100
commitcaddf21fca66c8339d01ef238c6cf060eb2090d4 (patch)
treedd58400116510c9606cdbe7858ddee0dbe907414 /src/error.rs
parent5379329ef71ba4b600eb028d721806a16e62535f (diff)
downloadvaultwarden-caddf21fca66c8339d01ef238c6cf060eb2090d4.tar.gz
vaultwarden-caddf21fca66c8339d01ef238c6cf060eb2090d4.zip
Log proper namespace in the err!() macro
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs
index b8e826ca..80f9dafc 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -191,6 +191,7 @@ impl<'r> Responder<'r> for Error {
fn respond_to(self, _: &Request) -> response::Result<'r> {
match self.error {
ErrorKind::EmptyError(_) => {} // Don't print the error in this situation
+ ErrorKind::SimpleError(_) => {} // Don't print the error in this situation
_ => error!(target: "error", "{:#?}", self),
};
@@ -210,9 +211,11 @@ impl<'r> Responder<'r> for Error {
#[macro_export]
macro_rules! err {
($msg:expr) => {{
+ error!("{}", $msg);
return Err(crate::error::Error::new($msg, $msg));
}};
($usr_msg:expr, $log_value:expr) => {{
+ error!("{}. {}", $usr_msg, $log_value);
return Err(crate::error::Error::new($usr_msg, $log_value));
}};
}