_map_error(DataError, ER.WARN_DATA_TRUNCATED, ER.WARN_NULL_TO_NOTNULL, ER.
    WARN_DATA_OUT_OF_RANGE, ER.NO_DEFAULT, ER.PRIMARY_CANT_HAVE_NULL, ER.
    DATA_TOO_LONG, ER.DATETIME_FUNCTION_OVERFLOW)
How to get the MySQL type of error with PyMySQL?