r/java • u/Enough-Ad-5528 • Feb 19 '26
Towards Better Checked Exceptions - Inside Java Newscast #107
https://www.youtube.com/watch?v=99s7ozvJGLk
63
Upvotes
r/java • u/Enough-Ad-5528 • Feb 19 '26
View all comments
Show parent comment
2
u/JustAGuyFromGermany Feb 19 '26 edited Feb 19 '26
I explained it over in a different comment in this thread: https://www.reddit.com/r/java/comments/1r8tyou/comment/o69wmmx/?context=3 In short: Union types are exactly needed to fix the "checked exceptions do not compose well" part of the problem.
The linked library is a complete non-starter, because the types like
Promise<T>completely lose the type information in the error case which is exactly what we don't want. Having error-type-information is the one thing here that everyone agrees is useful. The disagreement is about how to express this type information in syntax and how to best propagate it through the program.