diff --git a/crates/core/src/config.rs b/crates/core/src/config.rs index 0200a7f..8991fc2 100644 --- a/crates/core/src/config.rs +++ b/crates/core/src/config.rs @@ -23,7 +23,7 @@ impl Config { if let Err(e) = from_file { if e.kind() == ErrorKind::NotFound { - println!("creating default config under {file:?}"); + println!("creating default config under {}", file.to_string_lossy()); return Self::use_default_and_save_to(file); } else { bail!("unexpected error occured: {e:?}"); diff --git a/crates/core/src/core.rs b/crates/core/src/core.rs index c2c6664..6c7b923 100644 --- a/crates/core/src/core.rs +++ b/crates/core/src/core.rs @@ -313,7 +313,10 @@ fn show_error(error: &anyhow::Error, backend: &dyn Backend) { match get_single_var("RUST_BACKTRACE") { Some(s) => { if s == "1" || s == "full" { - println!("WARNING: skipping backend '{section}': {error:?}\n"); + eprintln!("WARNING: skipping backend '{section}':"); + for err in error.chain() { + eprintln!(" {err}"); + } } } None => println!("WARNING: skipping backend '{section}': {error}"), diff --git a/crates/core/src/grouping/group.rs b/crates/core/src/grouping/group.rs index 8d65ce2..f3a0d9d 100644 --- a/crates/core/src/grouping/group.rs +++ b/crates/core/src/grouping/group.rs @@ -27,7 +27,10 @@ impl Group { let path = file.path(); if config.warn_not_symlinks && !path.is_symlink() { - println!("WARNING: group file {path:?} is not a symlink"); + println!( + "WARNING: group file {} is not a symlink", + path.to_string_lossy() + ); } let group = @@ -88,12 +91,14 @@ impl Group { let mut sections = HashSet::new(); while lines.peek().is_some() { - match Section::try_from_lines(&mut lines).context("reading section") { + let result = Section::try_from_lines(&mut lines).context("reading section"); + match result { Ok(section) => { sections.insert(section); } Err(e) => { - println!("WARNING: could not process a section under group '{name}': {e:?}\n"); + let err = e.root_cause(); + println!("WARNING: could not process a section under group '{name}': {err}"); } } } diff --git a/crates/core/src/grouping/section.rs b/crates/core/src/grouping/section.rs index 1341d85..48aeee4 100644 --- a/crates/core/src/grouping/section.rs +++ b/crates/core/src/grouping/section.rs @@ -45,7 +45,7 @@ impl Section { } } - ensure!(!packages.is_empty()); + ensure!(!packages.is_empty(), "[{name}] is empty"); Ok(Self::new(name, packages)) }