Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The catch clause is permitted under EX0 of guideline ERR14-J. Do not catch RuntimeException; it serves as a general filter passing exceptions to the MyExceptionReporter class, which is dedicated to safely reporting exceptions, as recommended by guideline ERR01ERR00-J. Use a class dedicated to reporting Do not suppress or ignore checked exceptions. While this code only throws IllegalArgumentException the catch clause is general enough to handle any exception, in case the try block should be modified to throw other exceptions.

...