From f4d457bc046de86d965f77ef9e23330d92c07870 Mon Sep 17 00:00:00 2001 From: juliancoffee Date: Wed, 30 Jun 2021 21:05:34 +0300 Subject: [PATCH] Better error signaling in assets::load_dir_expect --- common/assets/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/assets/src/lib.rs b/common/assets/src/lib.rs index 886670a11a..bed643fc77 100644 --- a/common/assets/src/lib.rs +++ b/common/assets/src/lib.rs @@ -96,7 +96,8 @@ pub fn load_dir( #[track_caller] pub fn load_expect_dir(specifier: &str, recursive: bool) -> AssetDirHandle { - load_dir(specifier, recursive).expect("Failed loading directory") + load_dir(specifier, recursive) + .unwrap_or_else(|e| panic!("Failed loading directory. error={:?}", e)) } impl AssetExt for T {