Re:Unchecked Java: Say Goodbye to Checked Exceptions Forever
by bedobi on Thursday July 13, 2023 @03:16PM
(#36714597)
WirelessGigabit gets it. That last fact is huge - functional error handling forces callers to handle (or pass on) exactly what can go wrong, no more, no less. (unlike exceptions)
[ Parent
| on HN ]
Re:Unchecked Java: Say Goodbye to Checked Exceptions Forever
by wtetzner on Thursday July 13, 2023 @09:30PM
(#36718360)
That's not really true in practice. Often you just end up with a massive Error variant type that's used everywhere, even when the specific function you're calling could only return one of them.
Re:Unchecked Java: Say Goodbye to Checked Exceptions Forever
by WirelessGigabit on Friday July 14, 2023 @12:19AM
(#36719443)
You don't have to have Error variants if you don't care about their type.
You cannot catch a StackOverflowException or an OutOfMemoryException. All you do is log it & restart the app.
Once could split it into retryable errors and non-retryable ones. Like a DB disconnect, that can be retried.
BUT to be fair, that's not logic that belongs in the business.