Skip to content

Commit

Permalink
Updated remaining system panic messages to include the system name (b…
Browse files Browse the repository at this point in the history
…evyengine#1986)

Some panic messages for systems include the system name, but there's a few panic messages which do not. This PR adds the system name for the remaining panic messages.

This is a continuation of the work done in bevyengine#1864.
Related: bevyengine#1846
  • Loading branch information
TehPers authored and ostwilkens committed Jul 27, 2021
1 parent de82531 commit d78fa76
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions crates/bevy_ecs/src/system/system_param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,8 @@ impl<'a, T: Component> SystemParamFetch<'a> for ResMutState<T> {
.get_resource_unchecked_mut_with_id(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 Expand Up @@ -741,7 +742,8 @@ impl<'a, T: 'static> SystemParamFetch<'a> for NonSendState<T> {
.get_populated_resource_column(state.component_id)
.unwrap_or_else(|| {
panic!(
"Requested non-send resource does not exist: {}",
"Non-send resource requested by {} does not exist: {}",
system_state.name,
std::any::type_name::<T>()
)
});
Expand Down Expand Up @@ -871,7 +873,8 @@ impl<'a, T: 'static> SystemParamFetch<'a> for NonSendMutState<T> {
.get_populated_resource_column(state.component_id)
.unwrap_or_else(|| {
panic!(
"Requested non-send resource does not exist: {}",
"Non-send resource requested by {} does not exist: {}",
system_state.name,
std::any::type_name::<T>()
)
});
Expand Down

0 comments on commit d78fa76

Please sign in to comment.