DEV Community

Discussion on: On useless try-catches, being overly defensive, I/O boundaries and variable scope

Collapse
 
rikurouvila profile image
Riku Rouvila

Conceptually I like that a lot. If we'd have a way of defining thrown exceptions like Java's throws syntax, having the whole happy path inside the try block would feel a lot more comfortable.

Collapse
 
alainvanhout profile image
Alain Van Hout

Yes indeed. It's in fact from my own Java experience that I've come to use the approach 😄.