Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upError messages printed twice #154
Comments
This comment has been minimized.
This comment has been minimized.
|
I'd probably argue that the non-error-chain Error type here is implementing Display incorrectly: it does implement That said, it's a common pattern, and it's probably not going away, so it needs a solution. |
This comment has been minimized.
This comment has been minimized.
|
Proposal: in |
This comment has been minimized.
This comment has been minimized.
|
Seems easy to do, I don't see why is would be bad to skip an identical message. Do you want to try a PR? |
dtolnay commentedJun 3, 2017
The following code shows a reasonably written error type by a library not using error chain, as well as a chained error containing that one as a variant.
The output is:
This output is redundant but is a consequence of these interactions:
{}. It would not be nice for their Display implementation to just show"IO error".causeto expose the underlying IO error.Are there any patterns for eliminating the redundancy?