Skip to content

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

@alice-i-cecile

Description

@alice-i-cecile

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<E> 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 #17215 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-FeatureA new feature, making something new possibleD-ComplexQuite challenging from either a design or technical perspective. Ask for help!S-Needs-DesignThis issue requires design work to think about how it would best be accomplished

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions