bevyengine / bevyengine/bevy

Command error handling should work off of non-erased error types

Open
#17,273 3 comments 0 reactions 0 assignees View on GitHub
A-ECS C-Feature D-Complex S-Needs-Design
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.