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

Error's Display and Error::source contain duplicate info #312

Open
vilgotf opened this issue Nov 4, 2022 · 1 comment
Open

Error's Display and Error::source contain duplicate info #312

vilgotf opened this issue Nov 4, 2022 · 1 comment

Comments

@vilgotf
Copy link

vilgotf commented Nov 4, 2022

Error returns duplicate information since the error source is included in both the Display and Error::source, for example logging errors with tracing produce the following:

2022-11-04T19:05:01.777878Z  WARN crate: error=websocket errored error.sources=[IO error: unexpected end of file, unexpected end of file]

It would be nice to either include downstream error information in just the Error::source (leaving Display with "IO error") as discussed here: dtolnay/thiserror#38 or to not implement Error::source for the Error::Io variant.

@agalakhov
Copy link
Member

agalakhov commented Nov 4, 2022

Thank you for pointing on this. This is one of artifacts coming from pre-2018 Rust and from early versions of Tungstenite. This definitely needs reworking.

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

No branches or pull requests

2 participants