Skip to content

Commit 0a587ac

Browse files
committed
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
1 parent e3fb23d commit 0a587ac

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

crates/bevy_ecs/src/system/system_param.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,8 @@ impl<'a, T: Component> SystemParamFetch<'a> for ResMutState<T> {
407407
.get_resource_unchecked_mut_with_id(state.component_id)
408408
.unwrap_or_else(|| {
409409
panic!(
410-
"Requested resource does not exist: {}",
410+
"Resource requested by {} does not exist: {}",
411+
system_state.name,
411412
std::any::type_name::<T>()
412413
)
413414
});
@@ -741,7 +742,8 @@ impl<'a, T: 'static> SystemParamFetch<'a> for NonSendState<T> {
741742
.get_populated_resource_column(state.component_id)
742743
.unwrap_or_else(|| {
743744
panic!(
744-
"Requested non-send resource does not exist: {}",
745+
"Non-send resource requested by {} does not exist: {}",
746+
system_state.name,
745747
std::any::type_name::<T>()
746748
)
747749
});
@@ -871,7 +873,8 @@ impl<'a, T: 'static> SystemParamFetch<'a> for NonSendMutState<T> {
871873
.get_populated_resource_column(state.component_id)
872874
.unwrap_or_else(|| {
873875
panic!(
874-
"Requested non-send resource does not exist: {}",
876+
"Non-send resource requested by {} does not exist: {}",
877+
system_state.name,
875878
std::any::type_name::<T>()
876879
)
877880
});

0 commit comments

Comments
 (0)