Skip to content

Commit

Permalink
add filename to error message.
Browse files Browse the repository at this point in the history
Co-authored-by: Paul Hansen <mail@paul.rs>
  • Loading branch information
hymm and paul-hansen authored Mar 20, 2023
1 parent 2b88529 commit 6cd8245
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion crates/bevy_scene/src/scene_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,15 @@ impl AssetLoader for SceneLoader {
};
let scene = scene_deserializer
.deserialize(&mut deserializer)
.map_err(|e| deserializer.span_error(e))?;
.map_err(|e| {
let span_error = deserializer.span_error(e);
anyhow!(
"{} at {}:{}",
span_error.code
load_context.path().to_string_lossy(),
span_error.position,
)
})?;
load_context.set_default_asset(LoadedAsset::new(scene));
Ok(())
})
Expand Down

0 comments on commit 6cd8245

Please sign in to comment.