Prevent Catching System.Exception

  • Description Catching an exception that is high up in the exception hierarchy (System.Exception & System.ApplicationException) is almost always a bad idea. It is quick but will make the code-base unreadable in the long run.
  • Noncompliant Code Any code that catches System.Exception or System.ApplicationException
  • Compliant Code Code that catches an exception derived from System.ApplicationException
  • Edge Cases 1) Top-level exception handlers 2) Using exception filters
  • Type : Bug