Skip to main content

Table 1 Exception handling anti-patterns [15]

From: Studying the evolution of exception handling anti-patterns in a long-lived large-scale project

Anti-pattern

Meaning

Unhandled Exceptions

Exception handling does not capture all possible exceptions thrown in a try block.

Unreachable Handler

Exception handling code will never run.

Catch Generic

Exception handling captures many low-level exceptions by setting a high-level exception.

Destructive Wrapping

The developer propagates an exception as if it were another one. It causes loss of information regarding the original exception.

Catch and Do Nothing

Catch block code is empty.

Dummy Handler

The Exception handling code has no actions to recover errors.

Ignoring Interrupted Exception

Caught exception is ignored in the catch block.

Throw withing Finally

The code throws an exception within a finally block.

Generic Throw

The code throws a generic exception.