From 510ce5e832a1303c1d402e87ae6e04b1b4f3ad18 Mon Sep 17 00:00:00 2001 From: Mike Date: Wed, 29 Jun 2022 02:29:51 +0000 Subject: [PATCH] fix resource not found error message (#5128) There are some outdated error messages for when a resource is not found. It references `add_resource` and `add_non_send_resource` which were renamed to `insert_resource` and `insert_non_send_resource`. --- crates/bevy_ecs/src/world/mod.rs | 8 ++++---- crates/bevy_ecs/src/world/world_cell.rs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/bevy_ecs/src/world/mod.rs b/crates/bevy_ecs/src/world/mod.rs index 73d67a3174..5c75740f7b 100644 --- a/crates/bevy_ecs/src/world/mod.rs +++ b/crates/bevy_ecs/src/world/mod.rs @@ -791,7 +791,7 @@ impl World { Some(x) => x, None => panic!( "Requested resource {} does not exist in the `World`. - Did you forget to add it using `app.add_resource` / `app.init_resource`? + Did you forget to add it using `app.insert_resource` / `app.init_resource`? Resources are also implicitly added via `app.add_event`, and can be added by plugins.", std::any::type_name::() @@ -815,7 +815,7 @@ impl World { Some(x) => x, None => panic!( "Requested resource {} does not exist in the `World`. - Did you forget to add it using `app.add_resource` / `app.init_resource`? + Did you forget to add it using `app.insert_resource` / `app.init_resource`? Resources are also implicitly added via `app.add_event`, and can be added by plugins.", std::any::type_name::() @@ -877,7 +877,7 @@ impl World { Some(x) => x, None => panic!( "Requested non-send resource {} does not exist in the `World`. - Did you forget to add it using `app.add_non_send_resource` / `app.init_non_send_resource`? + Did you forget to add it using `app.insert_non_send_resource` / `app.init_non_send_resource`? Non-send resources can also be be added by plugins.", std::any::type_name::() ), @@ -897,7 +897,7 @@ impl World { Some(x) => x, None => panic!( "Requested non-send resource {} does not exist in the `World`. - Did you forget to add it using `app.add_non_send_resource` / `app.init_non_send_resource`? + Did you forget to add it using `app.insert_non_send_resource` / `app.init_non_send_resource`? Non-send resources can also be be added by plugins.", std::any::type_name::() ), diff --git a/crates/bevy_ecs/src/world/world_cell.rs b/crates/bevy_ecs/src/world/world_cell.rs index ba4d0b7011..c40a852a02 100644 --- a/crates/bevy_ecs/src/world/world_cell.rs +++ b/crates/bevy_ecs/src/world/world_cell.rs @@ -204,7 +204,7 @@ impl<'w> WorldCell<'w> { Some(x) => x, None => panic!( "Requested resource {} does not exist in the `World`. - Did you forget to add it using `app.add_resource` / `app.init_resource`? + Did you forget to add it using `app.insert_resource` / `app.init_resource`? Resources are also implicitly added via `app.add_event`, and can be added by plugins.", std::any::type_name::() @@ -239,7 +239,7 @@ impl<'w> WorldCell<'w> { Some(x) => x, None => panic!( "Requested resource {} does not exist in the `World`. - Did you forget to add it using `app.add_resource` / `app.init_resource`? + Did you forget to add it using `app.insert_resource` / `app.init_resource`? Resources are also implicitly added via `app.add_event`, and can be added by plugins.", std::any::type_name::() @@ -272,7 +272,7 @@ impl<'w> WorldCell<'w> { Some(x) => x, None => panic!( "Requested non-send resource {} does not exist in the `World`. - Did you forget to add it using `app.add_non_send_resource` / `app.init_non_send_resource`? + Did you forget to add it using `app.insert_non_send_resource` / `app.init_non_send_resource`? Non-send resources can also be be added by plugins.", std::any::type_name::() ), @@ -307,7 +307,7 @@ impl<'w> WorldCell<'w> { Some(x) => x, None => panic!( "Requested non-send resource {} does not exist in the `World`. - Did you forget to add it using `app.add_non_send_resource` / `app.init_non_send_resource`? + Did you forget to add it using `app.insert_non_send_resource` / `app.init_non_send_resource`? Non-send resources can also be be added by plugins.", std::any::type_name::() ),