bevyengine / bevyengine/bevy

Improve errors for recursive schedule running

Open
#17,428 1 comment 0 reactions 0 assignees View on GitHub
A-ECS C-Feature D-Modest S-Needs-Design
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## What problem does this solve or what need does it fill?

If you do `world.try_run_schedule(StateTransition)` in a system that runs `OnEnter`/`OnExit`, then you get this error: `TryRunScheduleError(StateTransition)`. The error implies you did not add the `StatesPlugin`, when in fact the schedule was removed because you are currently *in* the schedule.

## What solution would you like?

Improve errors for `try_run_schedule` when failure is caused by trying to run a schedule recursively.

## What alternative(s) have you considered?

None.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.