catching-non-exception / E0712#

Message emitted:

Catching an exception which doesn't inherit from Exception: %s

Description:

Used when a class which doesn't inherit from Exception is used as an exception in an except clause.

Correct code:

class FooError(Exception):
    pass


try:
    1 / 0
except FooError:
    pass

Problematic code:

class FooError:
    pass


try:
    1 / 0
except FooError:  # [catching-non-exception]
    pass

Created by the exceptions checker.