News for hackers. Stuff that matters.
Re:Error handling in Upspin by Shoothe on Thursday December 07, 2017 @05:05AM (#15868874)
Oh, it looks more and more like regular exceptions (nested errors, details, kinds).
Re:Error handling in Upspin by dullgiulio on Thursday December 07, 2017 @06:46AM (#15869267)
But this has never been where Go tries to be different from exceptions.

The only difference is explicit vs implicit (or at most, annotated methods in a class, but that doesn't say where each exception could happen.)

Annotating Go errors has always been suggested. Others have done a very good job for nested errors (Dave Cheney in particular.)

As Go doesn't have inheritance and errors are just values, you could always do what is suggested here. Just make sure to implement the one function Error interface.

As the article says, it takes one afternoon of work and you have error handling tailor made for your project.

Re:Error handling in Upspin by perfmode on Thursday December 07, 2017 @10:25AM (#15870800)
Except for control flow, which is my biggest gripe with exceptions.