protected static function wrapCurlError($ch)
    {
        $nativeCode = curl_errno($ch);
        $message    = 'Curl error: ' . curl_error($ch);
        if (!isset(self::$errorMap[$nativeCode])) {
            return new HTTP_Request2_Exception($message, 0, $nativeCode);
        } else {
            $class = self::$errorMap[$nativeCode][0];
            $code  = empty(self::$errorMap[$nativeCode][1])
                     ? 0 : self::$errorMap[$nativeCode][1];
            return new $class($message, $code, $nativeCode);
        }
    }
protected static function wrapCurlError($ch)
    {
        $nativeCode = curl_errno($ch);
        $message    = 'Curl error: ' . curl_error($ch);
        if (!isset(self::$errorMap[$nativeCode])) {
            return new HTTP_Request2_Exception($message, 0, $nativeCode);
        } else {
            $class = self::$errorMap[$nativeCode][0];
            $code  = empty(self::$errorMap[$nativeCode][1])
                     ? 0 : self::$errorMap[$nativeCode][1];
            return new $class($message, $code, $nativeCode);
        }
    }
protected static function wrapCurlError ( $ ch ) { $ nativeCode = curl_errno ( $ ch ) ; $ message = 'Curl error: ' . curl_error ( $ ch ) ; if ( ! isset ( self :: $ errorMap [ $ nativeCode ] ) ) { return new HTTP_Request2_Exception ( $ message , 0 , $ nativeCode ) ; } else { $ class = self :: $ errorMap [ $ nativeCode ] [ 0 ] ; $ code = empty ( self :: $ errorMap [ $ nativeCode ] [ 1 ] ) ? 0 : self :: $ errorMap [ $ nativeCode ] [ 1 ] ; return new $ class ( $ message , $ code , $ nativeCode ) ; } }
Creates a subclass of HTTP_Request2_Exception from curl error data

@param resource $ch curl handle

@return HTTP_Request2_Exception
Creates a subclass of HTTP_Request2_Exception from curl error data