From 0f3cc39264a05144437e84e5cd2e2d931472bb9a Mon Sep 17 00:00:00 2001 From: aawsome <37850842+aawsome@users.noreply.github.com> Date: Fri, 22 Mar 2024 08:21:45 +0100 Subject: [PATCH] fix: show log filename if open/creation failed (#1111) If opening or creating the logfile fails, rustic now shows the filename to allow users debug the error. closes #1105 --- src/commands.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/commands.rs b/src/commands.rs index 2672f7a51..7943d7f28 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -244,7 +244,16 @@ impl Configurable for EntryPoint { WriteLogger::new( level_filter, simplelog::Config::default(), - File::options().create(true).append(true).open(file)?, + File::options() + .create(true) + .append(true) + .open(file) + .map_err(|e| { + FrameworkErrorKind::PathError { + name: Some(file.clone()), + } + .context(e) + })?, ), ]) .map_err(|e| FrameworkErrorKind::ConfigError.context(e))?,