bevy icon indicating copy to clipboard operation
bevy copied to clipboard

Implement `SystemCondition` for systems returning `Result<bool, BevyError>` and `Result<(), BevyError>`

Open urben1680 opened this issue 7 months ago • 3 comments

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

So far systems that return bool are the only ones that can be used as conditions. Fallible systems as conditions need to either panic or do their own error handling, they hardly can snap into the usual error handling.

What solution would you like?

Implement SystemCondition for systems returning Result<bool, BevyError>.

The exact behavior on an error must be decided on: Should it go through the error handler? Either way, only systems returning Ok(true) should cause the condition to be evaluated as met.

Systems returning Result<(), BevyError> could also be used as conditions where Ok(()) is considered as a met condition.

urben1680 avatar May 27 '25 20:05 urben1680

I think fallible systems as run condition shouldn't run through the error handler, but directly consider that an error means the condition is false.

mockersf avatar May 27 '25 20:05 mockersf

I adjusted the issue a bit, for me it is not that important how it is handled, just that this is supported.

urben1680 avatar May 27 '25 21:05 urben1680

I think fallible systems as run condition shouldn't run through the error handler, but directly consider that an error means the condition is false.

Strongly agree with this :)

alice-i-cecile avatar May 27 '25 22:05 alice-i-cecile