Skip to content

Commit

Permalink
More detailed errors when resource not found (#1864)
Browse files Browse the repository at this point in the history
Fixes #1846

Got scared of the other "Requested resource does not exist" error at line 395 in `system_param.rs`, under `impl<'a, T: Component> SystemParamFetch<'a> for ResMutState<T> {`. Someone with better knowledge of the code might be able to go in and improve that one.
  • Loading branch information
therealstork committed Apr 14, 2021
1 parent 8aa22ba commit c86d490
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/bevy_ecs/src/system/system_param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ impl<'a, T: Component> SystemParamFetch<'a> for ResState<T> {
.get_populated_resource_column(state.component_id)
.unwrap_or_else(|| {
panic!(
"Requested resource does not exist: {}",
"Resource requested by {} does not exist: {}",
system_state.name,
std::any::type_name::<T>()
)
});
Expand Down

0 comments on commit c86d490

Please sign in to comment.