10.12.13 errors.custom_error_exception() Function

Syntax:

errors.custom_error_exception(error=None, exception=None)

This method defines custom exceptions for MySQL server errors
and returns current customizations.

If error is a MySQL Server error number, you
must also pass the exception class. The
error argument can be a dictionary, in which
case the key is the server error number, and value the class of
the exception to be raised.