News for hackers. Stuff that matters.
Re:Why Checked Exceptions Failed by kaba0 on Saturday July 15, 2023 @09:47AM (#36736711)
Yes, in Java’s parlance an Exception is a recoverable code path, Error is the kind that is not.

E.g. a network call failing due to some IOException can be easily retried, that’s a proper error handling.

Re:Why Checked Exceptions Failed by ahtihn on Saturday July 15, 2023 @03:09PM (#36739969)
How are you supposed to recover from IllegalArgumentException or NullPointerException?
Re:Why Checked Exceptions Failed by kaba0 on Saturday July 15, 2023 @05:33PM (#36741155)
Recoverable, as a technical term. You can catch an NPE and follow it with any kind of code you wish, it will be correctly “handled” by the VM. (The semantics of course depend on the exact specifics, but returning a server 500 error and not failing the process for example in a web server is completely valid).

You can try catching an OutOfMemory Error, but it is not guaranteed that your handling code can successfully run. Hence, non-recoverable.