Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jrobsonchase opened this issue Aug 20, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@jrobsonchase
Copy link
Contributor

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();
}
@russorat russorat added the enhancement New feature or request label Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants