3 ms·
Oh, it looks more and more like regular exceptions (nested errors, details, kinds).
by Shoothe 9y ago
Oh, it looks more and more like regular exceptions (nested errors, details, kinds).
- dullgiulio 9y agoBut 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.
- perfmode 9y agoExcept for control flow, which is my biggest gripe with exceptions.