4 ms·
He talks about "soft" errors as if the only way to handle them is to propagate them up to the UI layer, displaying a message. In many situations the error hand
by bluetomcat 11y ago
He talks about "soft" errors as if the only way to handle them is to propagate them up to the UI layer, displaying a message.
In many situations the error handling affects the code paths at a more profound level. Something might be considered an error in the callee, but at the same time it might be an acceptable result in the caller, for which a well-defined path exists. Throwing an exception in such situations is just disconnecting the faulting code from the error handling code.
- einrealist 11y agoThe perspective is about layered code and reuse. So what is wrong with delegation? My file access library should not know that it is linked in an application with an UI. Throwing an exception just delegates the issue to the code which depends on me. Whether the IO exception is really a problem can only be decided by the user of my library.