|
|
|
|
|
by otabdeveloper4
1975 days ago
|
|
> It's designed to force people to handle the damn error as near to the call as possible. This is always the wrong way to handle errors. If a function returns an 'error' that needs be handled at the call site, then it isn't an error, it's a variant return type. Errors are things that can't be recovered from but must be handled to release resources. You want this to happen in some central place, not scattered ad-hoc in every place where you use resources; releasing them by hand is worse than manual memory management. |
|
Not all errors require the same treatment and there isn’t a single strategy to manage them.