-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Better error handling for systems #11562
Copy link
Copy link
Closed as not planned
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-FeatureA new feature, making something new possibleA new feature, making something new possibleC-UsabilityA targeted quality-of-life change that makes Bevy easier to useA targeted quality-of-life change that makes Bevy easier to use
Description
What problem does this solve or what need does it fill?
Handling Result<T, E> inside systems currently feels a bit awkward. The few options we have right now:
- Call
.unwrap()everywhere. This feels very unidiomatic in Rust. - Write custom log messages everywhere. This feels very boilerplaty for what could've been a single
?. - Have your system return
Result<T, E>, then.pipe()it intobevy::utils::{warn, error, ...}.
I'm liking the third option the most. But the problem is that the log messages does not include any traceback information whatsoever, such as the name of the system where the error originated from. This makes it very hard to debug.
What solution would you like?
The usability of bevy::utils::{warn, error, ...} should be improved to make it easier to work with.
Or maybe there should be a built-in support for systems that returns Result<T, E>.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-FeatureA new feature, making something new possibleA new feature, making something new possibleC-UsabilityA targeted quality-of-life change that makes Bevy easier to useA targeted quality-of-life change that makes Bevy easier to use