Command error handling should work off of non-erased error types
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 161
Description
> I do agree that this could probably handle non-erased error types instead in the "specific-command error handler" case. I spent a bit of time investigating and got this largely working. I added a `type Error` associated type to `HandleError` and `CommandWithEntity`, and added an `ErrorHandler` type alias for a generic error handler function. This works for adding error handlers to specific commands, but there is a problem: The "default error handler" fundamentally requires the general-purpose bevy `Error` type, making it (not directly) usable for a signature that expects a specific error type. We want `queue` to be "default error conversion compatible" and `queue_handled` to require the concrete type. I'm reasonably certain this requires a duplication of traits.
>
> This is a big enough change that I think my preference is to defer it to a later PR.
_Originally posted by @cart in https://github.com/bevyengine/bevy/pull/17215#discussion_r1909721976_
Contributor guide
Assessment
This issue has not been assessed yet.