X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2Fhttp%2FCurlHttpRequest.php;h=3da3eb325c77916729882aa222530d85af835a81;hb=7d0d9815d38681ca884a7009c905a6443ed03a5a;hp=f58c3a9a5b7783008f655d6309893d96fbcbeda9;hpb=bdfe02223205923d923923dd420ba0dd863cd0fe;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/http/CurlHttpRequest.php b/includes/http/CurlHttpRequest.php index f58c3a9a5b..3da3eb325c 100644 --- a/includes/http/CurlHttpRequest.php +++ b/includes/http/CurlHttpRequest.php @@ -37,12 +37,17 @@ class CurlHttpRequest extends MWHttpRequest { return strlen( $content ); } + /** + * @see MWHttpRequest::execute + * + * @throws MWException + * @return Status + */ public function execute() { - - parent::execute(); + $this->prepare(); if ( !$this->status->isOK() ) { - return $this->status; + return Status::wrap( $this->status ); // TODO B/C; move this to callers } $this->curlOptions[CURLOPT_PROXY] = $this->proxy; @@ -102,7 +107,7 @@ class CurlHttpRequest extends MWHttpRequest { $curlHandle = curl_init( $this->url ); if ( !curl_setopt_array( $curlHandle, $this->curlOptions ) ) { - throw new MWException( "Error setting curl options." ); + throw new InvalidArgumentException( "Error setting curl options." ); } if ( $this->followRedirects && $this->canFollowRedirects() ) { @@ -140,7 +145,7 @@ class CurlHttpRequest extends MWHttpRequest { $this->parseHeader(); $this->setStatus(); - return $this->status; + return Status::wrap( $this->status ); // TODO B/C; move this to callers } /**