Reading the documentation or using some tool that helps you know which exceptions can be thrown. Although this is not so accurate, why capture Exception
it’s not a good idea.
If you’re going to relaunch the exception you’re doing something wrong, if you’re just going to relaunch it, don’t capture it. People capture a lot more exceptions than they should. They almost never manage to do anything useful with it. So let it propagate.
In Java too there is no way to know many exceptions and the ones that have are considered problematic in many situations even by most Java programmers who know what they are talking about.
For all this I think exception a wrong mechanism most of the time.
The Java engine that indicates an exception can be released is quite controversial and practice has shown that it brings more problems than solutions.
If there is something wrong, please inform me to improve.
– Maniero
Now that I see there’s a -1.. It wasn’t me.. I didn’t understand why
– igventurelli
@Igorventurelli know not. Had another.
– Maniero
I think it’s people who love exceptions, and anyone who thinks outside the box and knows what exceptions are bad mechanisms deserves a negative. It’s the sad reality of our profession, people believe a lot in what’s popular, not what makes sense.
– Maniero