public static function checkReconnectError($errorCode, $errorInfo, $exception) {
        if ($exception) {
            if (stripos($exception->getMessage(), self::MYSQL_GONE_AWAY) !== false || stripos($exception->getMessage(), self::MYSQL_REFUSED) !== false) {
                return true;
            }
        } elseif ($errorInfo) {
            if (stripos($errorInfo[2], self::MYSQL_GONE_AWAY) !== false || stripos($errorInfo[2], self::MYSQL_REFUSED) !== false) {
                return true;
            }
        }

        return false;
    }