Skip to content

Implement AppError::downcast and downcast_mut (currently stubs) #451

Description

@RAprogramm

AppError::downcast is documented as a stub and downcast_mut is documented as functional, but both unconditionally fail (introspection.rs): downcast always returns Err(self), downcast_mut always returns None. Only is/downcast_ref work (and they inspect the source, not the error itself).

anyhow provides full by-value/ref/mut downcasting (with a soundness fix for downcast_mut in 1.0.103). Implement real downcasting through the owned source, document the receiver semantics (source vs error), and add tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions