|
|
|
|
|
by mrkeen
2196 days ago
|
|
> Checked exceptions would have been an ok idea > Partially because people just get in the lazy habit of catch and rethrow RuntimeException, or catch and log, etc. when confronted with them. After quite a while of thinking this way, I came to the conclusion that: 95% of the time, there's no way to 'handle' an error in a 'make it right' sense. Disk write failed? REST request failed? DNS lookup? There usually isn't an alternative to logging/rethrowing. When there is a way to handle an error (usually by retrying?), it's top level anyway. Furthermore, IO is the stuff that can just 'go wrong' regardless of how good the programmer is, and IO tends to sit at the bottom in most Java programs. This means every method call is prone to IOExceptions. |
|
https://verraes.net/2014/12/erlang-let-it-crash/
If IOException on a read is truly happening, and it isn't just a case of a missing file, there are serious issues that aren't going to be fixed with a catch-and-log, or be able to be handled further up the call stack.