Skip to content

Conversation

@ThierryBerger
Copy link
Contributor

This allows user to react to an engine error, be it panic or try to fix the problem.

Took inspiration from https://github.com/bevyengine/bevy/blob/main/crates/bevy_ecs/src/error/handler.rs.

Current Status

Proof of concept is here, I'd like to add an example or test where user code is fixing an issue (removes a rigidbody ?)

More errors should probably be added in there.

Should this be behind a feature flag ?

no-std should be accounted for: be it allow it (custom oncelock), or not supporting it.

if proxy.aabb.mins[dim] < self.max_bound {
default_error_handler()(Error::SapAxisInsert(format!(
"proxy.aabb.mins {} (in {:?}) <= max_bound {}",
proxy.aabb.mins[dim], proxy.aabb, self.max_bound
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

store values rather than string (proxy.abb, dim, max_bounds)

// TODO: add more context:
// - offending rigidbody ?
// - backtrace ?
assert!(tx.send(1).is_ok());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: send the error

@Ralith
Copy link
Contributor

Ralith commented Oct 31, 2025

I would much rather see these errors propagated upwards where they occur. We don't need to replicate 1980s style error handling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants