Re:Error Handling in Go (2016)
by vldo on Friday April 05, 2019 @08:21PM
(#19588314)
so, what's the resolution, 3 years later?
[ Parent
| on HN ]
N years later, maybe we'll have the handle/check proposal[1] implemented. Which I'm actually fairly optimistic about - much of my error handling would be simplified by it, since in many cases (90%+?) any error can be treated as fatal.
There are, fortunately or unfortunately, a lot of very good counter-arguments and alternate proposals and specific implementation debates. So I'm not sure who long it'll take, and as much as I Want It Now™ I do think it's important to be careful for the long-term health of the language.
[1]: https://go.googlesource.com/proposal/+/master/design/go2draf... , or https://github.com/golang/go/wiki/Go2ErrorHandlingFeedback for the current state / counterpoints / etc
"Write `if res, err := foo(); err != nil { return nil, err }` everywhere all the time", apparently.