# Connector/Python: Class `mysql.connector.Error`
+ The `mysql.connector.errors` module defines most exception classes `Connector/Python` for errors and warnings
+ The base class for all errors in the errors module is `Error`
  + All subclasses have `errno` `sqlstate`, and `msg` attributes
+ Python maps `SQLSTATE` to the corresponding error class
  + For example: `DataError`, `ProgrammingError`
+ The `errorcode` module provides MySQL server and client error codes as class attributes to improve readability:
```
>>> ~!@from mysql.connector import errorcode@!~;
>>> dir(errorcode)
['CR_ALREADY_CONNECTED', 'CR_AUTH_PLUGIN_CANNOT_LOAD', 'CR_AUTH_PLUGIN_ERR', 'CR_CANT_READ_CHARSET', 'CR_COMMANDS_OUT_OF_SYNC', 'CR_CONNECTION_ERROR', 'CR_CONN_HOST_ERROR', 'CR_CONN_UNKNOW_PROTOCOL', 'CR_DATA_TRUNCATED', 'CR_DUPLICATE_CONNECTION_ATTR', 'CR_EMBEDDED_CONNECTION', 'CR_FETCH_CANCELED', 'CR_INSECURE_API_ERR', ...
...
```
----------------------------------------------------------------
All classes in the errors module inherit from the error class, which in turn inherits from the Python StandardError class. Inspect the properties of the class to determine the exact nature of the error. 