この製品は、重要な詳細を隠したり、特定の条件に対して不適切な対応をしたりする可能性のある、過度に広範な例外を投げたり上げたりする。
ExceptionやThrowableを投げるメソッドを宣言すると、一般的なエラー処理手順が促進され、呼び出し元が適切なエラー処理とエラー回復を行うことが難しくなります。例えば、Javaの例外メカニズムは、呼び出し側が何がうまくいかないかを予測し、それぞれの例外的な状況を処理するコードを書くことを容易にします。メソッドが一般的な形式の例外を投げると宣言することは、このシステムを破壊する。
The product throws or raises an overly broad exceptions that can hide important details and produce inappropriate responses to certain conditions.
Declaring a method to throw Exception or Throwable promotes generic error handling procedures that make it difficult for callers to perform proper error handling and error recovery. For example, Java's exception mechanism makes it easy for callers to anticipate what can go wrong and write code to handle each specific exceptional circumstance. Declaring that a method throws a generic form of exception defeats this system.