Added support for excluding specific exception classes.