Algebraic Effects for the Rest of Us
I doubt if you need any new language construct to introduce this. Could you not simply pass an error handling function&#x2F;object with all your functions&#x2F;methods, which is called when an error occurs? This function&#x2F;object could then resolve the error or throw an exception if it cannot resolve the error. It is possible, and relatively easy, to chain such error handling functions&#x2F;methods to implement complex error handling methods.