3 ms·
> There is not much sense in making them something special The reason you treat them as special is because at the point an error/exception occurs you are sayin
by wvenable 6y ago
> There is not much sense in making them something special
The reason you treat them as special is because at the point an error/exception occurs you are saying that your function (or program) can no longer do any more meaningful work, forward progress is now impossible, and you can't return anything meaningful.
We've gone backwards in making error returns explicit because the most common and intelligent thing to do is pass the error back up the chain or right out of the subsystem entirely. The lazy approach is the correct one with exceptions.
> Because in larger systems, the place where you handle the error is almost certainly not up the call stack, but in a different subsystem.
If your subsystem is network connected then the most likely cause of an re-startable operation is a minor network issue. There's no need to inform another subsystem immediately. I don't really see how it's an argument that exceptions don't scale. If you need to inform another subsystem you can do that.