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 iter_chain on ErrorCompat #187

Closed
prasannavl opened this issue Oct 10, 2019 · 1 comment · Fixed by #278
Closed

Implement iter_chain on ErrorCompat #187

prasannavl opened this issue Oct 10, 2019 · 1 comment · Fixed by #278

Comments

@prasannavl
Copy link

Copy over iter_chain from Rust unstable into ErrorCompat

Related: #186 (comment)
Depended by: #186

prasannavl added a commit to prasannavl/snafu that referenced this issue Oct 10, 2019
@Enet4
Copy link
Collaborator

Enet4 commented Jan 23, 2021

I would like to assist in this, as this seems to be the main blocker towards an error reporting abstraction for SNAFU.

The error handling working group has recently decided(see comment) on an error design guideline.

Return source errors via Error::source unless the source error's message is included in your own error message in Display.

And SNAFU sits in a tricky situation, due to how it is natural for source errors constructed via context selectors to also become available via Error::source. (I am not sure if there is a way to override this, although this feels hardly desirable.)

  • If your error prints the source on Display, the chain of messages will be included in the error message while also returning the source errors via Error::source, which goes against this guideline.
  • If your error does not print Display, we're good with the guideline, but SNAFU does not provide an error reporting mechanism that takes the full chain of errors into account, hence requiring users to copy their error reporting boilerplate.

I am not entirely sure of how one should go about this in the project, but I could take an attempt and let it go under review as a PR.

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 a pull request may close this issue.

2 participants