From c86d490a2007420296ddb321cd3389c2d13d7325 Mon Sep 17 00:00:00 2001 From: therealstork Date: Wed, 14 Apr 2021 22:52:43 +0000 Subject: [PATCH] More detailed errors when resource not found (#1864) 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 {`. Someone with better knowledge of the code might be able to go in and improve that one. --- crates/bevy_ecs/src/system/system_param.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/bevy_ecs/src/system/system_param.rs b/crates/bevy_ecs/src/system/system_param.rs index 0fb6c2fffa..99c9e26d8c 100644 --- a/crates/bevy_ecs/src/system/system_param.rs +++ b/crates/bevy_ecs/src/system/system_param.rs @@ -242,7 +242,8 @@ impl<'a, T: Component> SystemParamFetch<'a> for ResState { .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::() ) });