Re:A new approach to error handling
by Nullabillity on Tuesday July 30, 2024 @04:18PM
(#41113702)
It works, until it doesn't. Exceptions are the one place in Java that supports union types, if you have code that can throw both Exception1 and Exception2 then Java can keep track of whether they are thrown separately:
However, if you pass them through a generic then they will be flattened into the closest common ancestor:
[ Parent
| on HN ]
There are no comments on this comment yet.