例外処理/エラー処理の設計パターンを説明しているリソース (Web または書籍) はありますか?
きれいなコードの書き方に関する文献はたくさんありますし、デザイン パターンを扱った本もたくさんあります。しかし、どこでどのようにエラーを処理するのが最善か、また、低レベル関数に現れるエラーを抽象化のレベルまで伝播するのが最善かという問題をカバーする設計パターンを見たことがありません。
例外処理/エラー処理の設計パターンを説明しているリソース (Web または書籍) はありますか?
きれいなコードの書き方に関する文献はたくさんありますし、デザイン パターンを扱った本もたくさんあります。しかし、どこでどのようにエラーを処理するのが最善か、また、低レベル関数に現れるエラーを抽象化のレベルまで伝播するのが最善かという問題をカバーする設計パターンを見たことがありません。
These patterns and best practices are often bound to a specific platform/language, so they are the first place to look for them.
As an example check the following links for java:
Going through such materials would give you a general idea to follow in exception handling mechanisms.
Also check other SO questions:
Best approach is never to swallow any exceptions within your application code. Hookup a handler to unhandled exceptions in your applications when bootstrapping where you can show an error message and do some logging.
Some decent books i've read recommended this approach.
http://thibautvs.com/blog/?p=2238 is a good one where it's mentioned.
.NET (だけでなく) での例外の使用の詳細: http://msdn.microsoft.com/en-gb/library/5b2yeyab(v=vs.100).aspx
いつ使うべきか、どのように書くべきか、どのように正しく扱うべきかなど...