.. _catching-non-exception:

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.*

**Problematic code:**

.. literalinclude:: /data/messages/c/catching-non-exception/bad.py
   :language: python

**Correct code:**

.. literalinclude:: /data/messages/c/catching-non-exception/good.py
   :language: python



Created by the `exceptions <https://github.com/PyCQA/pylint/blob/main/pylint/checkers/exceptions.py>`__ checker.