From d1f0a169500a03f03245708e017d03a3a6cb48a5 Mon Sep 17 00:00:00 2001 From: pwygab Date: Fri, 2 Sep 2022 12:18:44 +0000 Subject: [PATCH] improve panic messages for add_system_to_stage and add_system_set_to_stage (#5847) # Objective - Make the panic messages more specific and understandable. - Fixes #5811 ## Solution - Edit the panic message. --- --- crates/bevy_app/src/app.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/bevy_app/src/app.rs b/crates/bevy_app/src/app.rs index 7d6c027da0cdf..55722cd9e9a0c 100644 --- a/crates/bevy_app/src/app.rs +++ b/crates/bevy_app/src/app.rs @@ -382,7 +382,7 @@ impl App { use std::any::TypeId; assert!( stage_label.type_id() != TypeId::of::(), - "add systems to a startup stage using App::add_startup_system_to_stage" + "use `add_startup_system_to_stage` instead of `add_system_to_stage` to add a system to a StartupStage" ); self.schedule.add_system_to_stage(stage_label, system); self @@ -417,7 +417,7 @@ impl App { use std::any::TypeId; assert!( stage_label.type_id() != TypeId::of::(), - "add system sets to a startup stage using App::add_startup_system_set_to_stage" + "use `add_startup_system_set_to_stage` instead of `add_system_set_to_stage` to add system sets to a StartupStage" ); self.schedule .add_system_set_to_stage(stage_label, system_set);