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.

---
This commit is contained in:
pwygab 2022-09-02 12:18:44 +00:00
parent 480b3baa44
commit 6b87fb0bdb

View File

@ -382,7 +382,7 @@ impl App {
use std::any::TypeId;
assert!(
stage_label.type_id() != TypeId::of::<StartupStage>(),
"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::<StartupStage>(),
"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);