Skip to content

Commit

Permalink
fix: show log filename if open/creation failed (#1111)
Browse files Browse the repository at this point in the history
If opening or creating the logfile fails, rustic now shows the filename
to allow users debug the error.

closes #1105
  • Loading branch information
aawsome authored Mar 22, 2024
1 parent 07f92d8 commit 0f3cc39
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,16 @@ impl Configurable<RusticConfig> 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))?,
Expand Down

0 comments on commit 0f3cc39

Please sign in to comment.