"""
MySQL工具库自定义异常类
"""


class MySQLBaseException(Exception):
    """MySQL工具库基础异常类"""

    def __init__(self, message: str, error_code: str = None, original_error: Exception = None):
        self.message = message
        self.error_code = error_code
        self.original_error = original_error
        super().__init__(self.message)


class MySQLConnectionError(MySQLBaseException):
    """MySQL连接异常"""
    pass


class MySQLConfigError(MySQLBaseException):
    """MySQL配置异常"""
    pass


class MySQLQueryError(MySQLBaseException):
    """MySQL查询异常"""
    pass


class MySQLTransactionError(MySQLBaseException):
    """MySQL事务异常"""
    pass


class MySQLPoolError(MySQLBaseException):
    """MySQL连接池异常"""
    pass


class MySQLValidationError(MySQLBaseException):
    """MySQL数据验证异常"""
    pass