Skip to content

Add the ability to attach context to BevyError #19714

Open
@Shatur

Description

@Shatur

What problem does this solve or what need does it fill?

I sometimes call functions inside Bevy systems that return errors. But in applications it's quite useful to have "layered" errors. For example:

Error: unable to apply replication.

Caused by:
    Unable to deserialize message for tick 14
    Unable to deserialize entity 1v4

What solution would you like?

It would be great something similar to anyhow - an extension trait on any result or option that attaches context.

What alternative(s) have you considered?

Format errors like this manually. But it's not very ergonomic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-DiagnosticsLogging, crash handling, error reporting and performance analysisC-FeatureA new feature, making something new possibleS-Needs-InvestigationThis issue requires detective work to figure out what's going wrong

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions