Re:New in Go 1.20: wrapping multiple errors
by XorNot on Sunday December 11, 2022 @09:07AM
(#33943292)
> the best place to handle an error is also not the same as the best place to decide how to handle the error.
I'm not sure I follow the distinction here, or at least why it would be important? i.e. if I parse "decide how to handle the error" as catching the exception, where I handle it is surely basically anywhere since I'm not restricted in calling into other code to do so.
Common Lisp exceptions are resumable which is the main difference between it and more common languages like Java and C++. e.g. "Decide" can also include deciding to retry the operation with different inputs.
So far, the only programming environment I've seen that makes a three-way distinction between raising, recovering, and deciding how to recover from an error is Common Lisp with its condition system[1]. However, I've successfully implemented the idea in Java using exceptions as the non-local control flow primitive, and in C using setjmp/longjmp.
[1]: https://lispcookbook.github.io/cl-cookbook/error_handling.ht...