-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Make AppExit more specific about exit reason.
#13022
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
|
This design is really nice! I like the approach taken, and the integration with the std::ExitCode is a great idea. |
436d6d4 to
9d5cba3
Compare
|
bevy/crates/bevy_app/src/app.rs Lines 865 to 867 in 8db3d1d
Regarding this function. I don't know why for example the schedule runner uses it's own |
a8ebbf6 to
e00effa
Compare
|
Manual event readers are required when working with exclusive world access, such as when We could use one-shot systems these days, but I'm not sure it would be an improvement. |
The question is why do our app runners maintain event reader state at all. Both the |
BD103
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a big fan of this change, thanks for working on it! I have a few suggestions for making some AppExit methods const, but they're non-blocking.
The only other thing I want to bring up are the two BEFORE_MERGE comments, just so they don't get skipped. :)
Yeah, I don't think that we need to maintain event reader state in this case. I think we should make that change in a different PR though: it'll make it easier to test and review. |
|
Thank you to everyone involved with the authoring or reviewing of this PR! This work is relatively important and needs release notes! Head over to bevyengine/bevy-website#1300 if you'd like to help out. |
Objective
Closes #13017.
Solution
AppExita enum with aSuccessandErrorvariant.App::run()return aAppExitif it ever returns.AppExitto signal if they encountered a error.Changelog
Added
App::should_exitAppExitto thebevyandbevy_apppreludes,Changed
AppExitis now a enum with 2 variants (SuccessandError).AppExit.App::run()now also returns theAppExitproduced by the runner function.Migration Guide
AppExitwithAppExit::SuccessorAppExit::Failure.AppExit. We suggest you return aAppExit::Errorif anyAppExitraised was a Error. You can use the newApp::should_exitmethod.mainany other way. You should return theAppExitfromApp::run()so the app correctly returns a error code if anything fails e.g.