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

Implement std::error::Error #8

Merged
merged 1 commit into from
Jun 25, 2024
Merged

Implement std::error::Error #8

merged 1 commit into from
Jun 25, 2024

Conversation

schneems
Copy link
Owner

I want to use this in a Box<dyn Error> but the error trait was missing an implementation.

From https://doc.rust-lang.org/std/error/trait.Error.html#method.source

Errors may provide cause information. Error::source() is generally used when errors cross “abstraction boundaries”. If one module must report an error that is caused by an error from a lower-level module, it can allow accessing that error via Error::source(). This makes it possible for the high-level module to provide its own errors while also revealing some of the implementation for debugging.

I want to use this in a `Box<dyn Error>` but the error trait was missing an implementation.

From https://doc.rust-lang.org/std/error/trait.Error.html#method.source

> Errors may provide cause information. Error::source() is generally used when errors cross “abstraction boundaries”. If one module must report an error that is caused by an error from a lower-level module, it can allow accessing that error via Error::source(). This makes it possible for the high-level module to provide its own errors while also revealing some of the implementation for debugging.
@schneems schneems force-pushed the schneems/impl-error branch from 41b07b0 to 00b6fe8 Compare June 25, 2024 21:18
@schneems schneems marked this pull request as ready for review June 25, 2024 22:56
@schneems schneems merged commit b31ad1b into main Jun 25, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant