Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #23842: Improve rudder-package error messages #5237

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion relay/sources/rudder-package/src/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ mod tests {
}

#[test]
fn test_get_archive_installed_filed() {
fn test_get_archive_installed_files() {
let r = Rpkg::from_path("./tests/archive/rudder-plugin-notify-8.0.0-2.2.rpkg").unwrap();
assert_eq!(
r.get_archive_installed_files().unwrap(),
Expand Down Expand Up @@ -352,4 +352,12 @@ mod tests {
.unwrap();
assert!(!dir_diff::is_different(effective_target, expected_dir_content).unwrap());
}

#[test]
fn test_extract_broken_archive() {
let r = Rpkg::from_path("./tests/archive/broken-archive.rpkg").unwrap();
assert!(r
.unpack_embedded_txz("files.txz", tempdir().unwrap().into_path())
.is_err());
}
}
18 changes: 12 additions & 6 deletions relay/sources/rudder-package/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ pub fn run() -> Result<()> {
for p in &long_names(package) {
if let Err(e) = db.install(force, p, &repo, index.as_ref(), &mut webapp) {
errors = true;
error!("Installation of {} failed: {e}", short_name(p));
error!("Installation of {} failed: {e:?}", short_name(p));
}
}
if errors {
Expand All @@ -121,7 +121,7 @@ pub fn run() -> Result<()> {
for p in &long_names(package) {
if let Err(e) = db.uninstall(p, true, &mut webapp) {
errors = true;
error!("Uninstallation of {} failed: {e}", short_name(p));
error!("Uninstallation of {} failed: {e:?}", short_name(p));
}
}
if errors {
Expand All @@ -145,7 +145,7 @@ pub fn run() -> Result<()> {
errors = true;
// Don't fail and continue
error!(
"Postinst script for {} failed: {e}",
"Postinst script for {} failed: {e:?}",
p.metadata.short_name()
);
}
Expand Down Expand Up @@ -175,7 +175,7 @@ pub fn run() -> Result<()> {
for p in &to_upgrade {
if let Err(e) = db.install(false, p, &repo, index.as_ref(), &mut webapp) {
errors = true;
error!("Could not upgrade {}: {e}", short_name(p))
error!("Could not upgrade {}: {e:?}", short_name(p))
}
}
if errors {
Expand Down Expand Up @@ -243,7 +243,10 @@ pub fn run() -> Result<()> {
Some(p) => {
if let Err(e) = p.enable(&mut webapp) {
errors = true;
error!("Could not enable plugin {}: {e}", p.metadata.short_name());
error!(
"Could not enable plugin {}: {e:?}",
p.metadata.short_name()
);
}
}
}
Expand Down Expand Up @@ -285,7 +288,10 @@ pub fn run() -> Result<()> {
Some(p) => {
if let Err(e) = p.disable(&mut webapp) {
errors = true;
error!("Could not disable plugin {}: {e}", p.metadata.short_name());
error!(
"Could not disable plugin {}: {e:?}",
p.metadata.short_name()
);
}
}
}
Expand Down
Binary file not shown.