-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Proposal: Add Go 1.13 error handling to Error section #334
Comments
I think it's a good idea in general, but the devil is in the details. Wrapping errors is a power use, but gobyexample tries to stick to simpler concepts. Detailed discussion can take over a concrete PR, I just wanted to provide some background. |
Hi, I have prepared an answer to the problem, raised in the link below. Hope you enjoy it :) |
@Omid-SH consider submitting a PR with a simple example to this repository. That will be easier to review. |
Yes, the page about errors could be improved. I am missing sentinel errors. We use them a lot and use errors.Is() often. The current state seems to be: Waiting for PR. I hope I can provide one during the next days. |
I created PR #517 which adds modern error handling. Please take a look. Feel free to take the PR and adapt it the way you want. Sometimes this is easier than telling me what I should change. |
Fixes #334 * Add wrapping errors. Before there was one page about error handling. Now there are three. A simple page (the first part of the existing page). Then a new page about wrapping errors. And the third page is the second half of the existing page (custom errors). * ... addressed pr feedback. * ./tools/build was run.
Hi thanks for this super site.
I am going through it line by line at the moment and wondered if it would be worth making an addition to the existing Error page? Specifically, the new
%w
,Unwrap
,Is
andAs
methods inerror
. I don't think the new methods should replace the existing content, only compliment it.I am happy to contribute the example should this idea be accepted.
The text was updated successfully, but these errors were encountered: