I think, this is the most important advice related with exceptions, which might cause to put your hands around your head for hours while debugging a problem otherwise.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Empty catch block ignores exception - Highly suspect! | |
try{ | |
..... | |
}catch(SomeException e){ | |
} |
An empty catch block defeats the purpose of exception. Whenever you see an empty catch block, alarm bells should go off in your head. At the very least, the catch block should contain a comment explaining whit it is appropriate to ignore the exception.
No comments:
Post a Comment