3 ms·
If the method you're designing is going to throw an exception that wouldn't make sense to handle from a consumer standpoint, creating an exception that extends
by exception_e 10y ago
If the method you're designing is going to throw an exception that wouldn't make sense to handle from a consumer standpoint, creating an exception that extends `RuntimeException` would be my advice. I agree that empty catch blocks are not a good idea.
- daemin 10y agoIt would b a good idea to catch it. Except Java has a FileNotFound exception when trying to open something, which to me should just be part of the normal control flow and is not something exceptional. That and you tend to get code that just "throws Exception" propagated all the way down to main. I know I've done it for little projects at Uni (when I last programmed in Java, 3.0 I think?)