From c24131d383eaafd74c2ff2f1adc0442f92f20715 Mon Sep 17 00:00:00 2001 From: mbecker20 Date: Sat, 15 Jun 2024 20:37:29 -0700 Subject: [PATCH] nested propogate read resources error --- bin/core/src/helpers/sync/file.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/bin/core/src/helpers/sync/file.rs b/bin/core/src/helpers/sync/file.rs index 878cdbfc4..56c224e5d 100644 --- a/bin/core/src/helpers/sync/file.rs +++ b/bin/core/src/helpers/sync/file.rs @@ -60,15 +60,9 @@ fn read_resources_recursive( .context("failed to read directory contents")?; for entry in directory.into_iter().flatten() { let path = entry.path(); - if let Err(e) = read_resources_recursive(&path, resources, log) - { - log.push('\n'); - log.push_str(&format!( - "{}: failed to read additional resources from {} | {e:#}", - colored("ERROR", Color::Red), - colored(&path.display().to_string(), Color::Blue) - )); - } + read_resources_recursive(&path, resources, log).with_context( + || format!("failed to read resources from {path:?}"), + )?; } Ok(()) } else {