Convert to fallible system in IntoSystemConfigs#17051
Merged
alice-i-cecile merged 12 commits intobevyengine:mainfrom Dec 31, 2024
Merged
Convert to fallible system in IntoSystemConfigs#17051alice-i-cecile merged 12 commits intobevyengine:mainfrom
alice-i-cecile merged 12 commits intobevyengine:mainfrom
Conversation
Member
|
@Neo-Zhixing how do you feel about this implementation instead? |
alice-i-cecile
approved these changes
Dec 30, 2024
Member
alice-i-cecile
left a comment
There was a problem hiding this comment.
I prefer this design: I think it's clearer and reducing the branching is good.
Contributor
|
Seems great! Have you tested logging and panics to see if this mangles the source tracking, as was the issue in #8705? |
Contributor
Author
I'll check, but it should be fine. This should just add one more line to the backtrace. |
NthTensor
approved these changes
Dec 31, 2024
Contributor
Author
|
Panics seem ok. |
Contributor
|
Oops I'm a bit late to the discussions, but this is clearly a much better approach. |
ecoskey
pushed a commit
to ecoskey/bevy
that referenced
this pull request
Jan 6, 2025
# Objective - bevyengine#16589 added an enum to switch between fallible and infallible system. This branching should be unnecessary if we wrap infallible systems in a function to return `Ok(())`. ## Solution - Create a wrapper system for `System<(), ()>`s that returns `Ok` on the call to `run` and `run_unsafe`. The wrapper should compile out, but I haven't checked. - I removed the `impl IntoSystemConfigs for BoxedSystem<(), ()>` as I couldn't figure out a way to keep the impl without double boxing. ## Testing - ran `many_foxes` example to check if it still runs. ## Migration Guide - `IntoSystemConfigs` has been removed for `BoxedSystem<(), ()>`. Either use `InfallibleSystemWrapper` before boxing or make your system return `bevy::ecs::prelude::Result`.
mrchantey
pushed a commit
to mrchantey/bevy
that referenced
this pull request
Feb 4, 2025
# Objective - bevyengine#16589 added an enum to switch between fallible and infallible system. This branching should be unnecessary if we wrap infallible systems in a function to return `Ok(())`. ## Solution - Create a wrapper system for `System<(), ()>`s that returns `Ok` on the call to `run` and `run_unsafe`. The wrapper should compile out, but I haven't checked. - I removed the `impl IntoSystemConfigs for BoxedSystem<(), ()>` as I couldn't figure out a way to keep the impl without double boxing. ## Testing - ran `many_foxes` example to check if it still runs. ## Migration Guide - `IntoSystemConfigs` has been removed for `BoxedSystem<(), ()>`. Either use `InfallibleSystemWrapper` before boxing or make your system return `bevy::ecs::prelude::Result`.
JeanMertz
added a commit
to dcdpr/bevy
that referenced
this pull request
Feb 7, 2025
This commit builds on top of the work done in bevyengine#16589 and bevyengine#17051, by adding support for fallible observer systems. As with the previous work, the actual results of the observer system are suppressed by default, but the intention is to provide a way to handle errors in a global way. Until then, you can use a `PipeSystem` to manually handle results. Signed-off-by: Jean Mertz <[email protected]>
JeanMertz
added a commit
to dcdpr/bevy
that referenced
this pull request
Feb 7, 2025
This commit builds on top of the work done in bevyengine#16589 and bevyengine#17051, by adding support for fallible observer systems. As with the previous work, the actual results of the observer system are suppressed by default, but the intention is to provide a way to handle errors in a global way. Until then, you can use a `PipeSystem` to manually handle results. Signed-off-by: Jean Mertz <[email protected]>
JeanMertz
added a commit
to dcdpr/bevy
that referenced
this pull request
Feb 9, 2025
You can now configure error handlers for fallible systems. These can be configured on several levels: - Globally via `App::set_systems_error_handler` - Per-schedule via `Schedule::set_error_handler` - Per-system via a piped system (this is existing functionality) The "fallible_systems" example demonstrates the new functionality. This builds on top of bevyengine#17731, bevyengine#16589, bevyengine#17051. Signed-off-by: Jean Mertz <[email protected]>
github-merge-queue bot
pushed a commit
that referenced
this pull request
Feb 11, 2025
You can now configure error handlers for fallible systems. These can be configured on several levels: - Globally via `App::set_systems_error_handler` - Per-schedule via `Schedule::set_error_handler` - Per-system via a piped system (this is existing functionality) The default handler of panicking on error keeps the same behavior as before this commit. The "fallible_systems" example demonstrates the new functionality. This builds on top of #17731, #16589, #17051. --------- Signed-off-by: Jean Mertz <[email protected]>
github-merge-queue bot
pushed a commit
that referenced
this pull request
Feb 11, 2025
This commit builds on top of the work done in #16589 and #17051, by adding support for fallible observer systems. As with the previous work, the actual results of the observer system are suppressed for now, but the intention is to provide a way to handle errors in a global way. Until then, you can use a `PipeSystem` to manually handle results. --------- Signed-off-by: Jean Mertz <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Ok(()).Solution
System<(), ()>s that returnsOkon the call torunandrun_unsafe. The wrapper should compile out, but I haven't checked.impl IntoSystemConfigs for BoxedSystem<(), ()>as I couldn't figure out a way to keep the impl without double boxing.Testing
many_foxesexample to check if it still runs.Migration Guide
IntoSystemConfigshas been removed forBoxedSystem<(), ()>. Either useInfallibleSystemWrapperbefore boxing or make your system returnbevy::ecs::prelude::Result.