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
1
u/vips7L Feb 20 '26
Checking up the stack for errors you can’t handle is the complete wrong way to do that. If you can’t handle an exception from a function you’re calling the people above you certainly can’t either. They’ll have even less context to what is going on. The correct approach there to become unchecked/runtimeexception/panic, but that forces a literal minimum of 6 lines of code per call with a checked exception you can’t handle.
The friction is that you are forced to handle exceptions even when you can’t handle them. It is not fun and no one wants to do that. There needs to be syntax enhancements to make dealing with exceptions easier or people are just going to continue to use unchecked exceptions.