Skip to content

The Rust-error-to-Exception conversion should include the Error::source chain #62

Description

@jrobsonchase

For example, see the original error in #61.

Instead of just stringifying the top-level error, we should also walk the chain of Error::sources and append them to the message.

For example:

let mut msg = format!("{e}");

let mut dyn_e = e.source();
while dyn_e.is_some() {
    write!(&mut msg, ": {}", dyn_e.unwrap()).unwrap();
    dyn_e = dyn_e.unwrap().source();
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions