|
|
|
|
|
by randomswede
1865 days ago
|
|
In Go, I would do one of:
* Pass the error value up unchanged
* Wrap the error inside another error
* Pass a new error
* Swallow the error and do something else to cope with failure I would probably also do some error logging, capturing the state of relevant local variables, especially if it is one of those cases where "see an error" is unexpected. |
|
I suppose they're two sides of the same coin. Both can be done well or poorly.
I do resent the idea that error values are automatically better or easier to understand, because I'm dealing with some poorly done error values now and wishing for traditional exception handling.