From 0a587ac3b5acd86b1abd346ee2feb701e6c63b37 Mon Sep 17 00:00:00 2001 From: TehPers Date: Fri, 23 Apr 2021 17:54:04 +0000 Subject: [PATCH] Updated remaining system panic messages to include the system name (#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 #1864. Related: #1846 --- crates/bevy_ecs/src/system/system_param.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/bevy_ecs/src/system/system_param.rs b/crates/bevy_ecs/src/system/system_param.rs index f7bbf4da4889f..511fc31927d9e 100644 --- a/crates/bevy_ecs/src/system/system_param.rs +++ b/crates/bevy_ecs/src/system/system_param.rs @@ -407,7 +407,8 @@ impl<'a, T: Component> SystemParamFetch<'a> for ResMutState { .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::() ) }); @@ -741,7 +742,8 @@ impl<'a, T: 'static> SystemParamFetch<'a> for NonSendState { .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::() ) }); @@ -871,7 +873,8 @@ impl<'a, T: 'static> SystemParamFetch<'a> for NonSendMutState { .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::() ) });