May someone point me to an opensource project or a book or a site or any tips whatsoever for "good practices" in deal开发者_如何学运维ing with exception - e.g. retrying the offending code or any other accepted strategy.
- Exception Antipatterns
- 10 best practices
There's an entire chapter in Joshua Bloch's Effective Java dedicated to effective use of exceptions. This book comes highly recommended for any professional Java developer. I suggest that your purchase it (hehe..excuse the sales pitch).
In addition to Effective Java, there's an entire book dealing with exception and error handling in Java.
I liked this article: http://blogs.msdn.com/b/codeanalysis/archive/2006/06/14/631923.aspx
It's about a code analysis tool which complains about catching general exceptions. But it also describes pretty well how exception handling should be done in the right way.
Joshua Bloch's Effective Java: Programming Language Guide (Addison-Wesley, 2001) has a chapter dedicated to exception handling.
精彩评论