From e17e6d117420abed58df39e939489ab01a78c459 Mon Sep 17 00:00:00 2001 From: Rodolphe Breard Date: Wed, 26 Aug 2020 17:39:37 +0200 Subject: [PATCH] Add the PID file name in the error message Rel #24 --- acme_common/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/acme_common/src/lib.rs b/acme_common/src/lib.rs index affbb6e..54b79da 100644 --- a/acme_common/src/lib.rs +++ b/acme_common/src/lib.rs @@ -14,7 +14,7 @@ macro_rules! exit_match { match $e { Ok(_) => {} Err(e) => { - eprintln!("Error: {}", e); + log::error!("Error: {}", e); std::process::exit(3); } } @@ -47,7 +47,7 @@ pub fn init_server(foreground: bool, pid_file: Option<&str>, default_pid_file: & let daemonize = Daemonize::new().pid_file(pid_file.unwrap_or(default_pid_file)); exit_match!(daemonize.start()); } else if let Some(f) = pid_file { - exit_match!(write_pid_file(f)); + exit_match!(write_pid_file(f).map_err(|e| e.prefix(f))); } }