Show errors loading individual files during glob asset loading

This commit is contained in:
Imbris 2020-04-01 20:37:23 -04:00
parent 831d7c77a6
commit 4652ae2f03

View File

@ -116,7 +116,16 @@ pub fn load_glob<A: Asset + 'static>(specifier: &str) -> Result<Arc<Vec<Arc<A>>>
let assets = Arc::new(
glob_matches
.into_iter()
.filter_map(|name| load(&specifier.replace("*", &name)).ok())
.filter_map(|name| {
load(&specifier.replace("*", &name))
.map_err(|e| {
error!(
"Failed to load \"{}\" as part of glob \"{}\" with error: {:?}",
name, specifier, e
)
})
.ok()
})
.collect::<Vec<_>>(),
);
let clone = Arc::clone(&assets);