Skip to content

Commit

Permalink
improve panic messages for add_system_to_stage and add_system_set_to_…
Browse files Browse the repository at this point in the history
…stage (bevyengine#5847)

# Objective

- Make the panic messages more specific and understandable.
- Fixes bevyengine#5811 
## Solution

- Edit the panic message.

---
  • Loading branch information
merelymyself authored and james7132 committed Oct 28, 2022
1 parent ee4ccc9 commit d1f0a16
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/bevy_app/src/app.rs
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit d1f0a16

Please sign in to comment.