Merge pull request #1230 from oddnoc/3.1-restfulservice-error-check

BUG: Fetch curl_error in RestfulService
This commit is contained in:
Sam Minnée 2013-02-24 17:59:32 -08:00
commit b90e0c0955

View File

@ -299,7 +299,7 @@ class RestfulService extends ViewableData {
//get the status code
$statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
//normalise the status code
if($curlError !== '' || $statusCode == 0) $statusCode = 500;
if(curl_error($ch) !== '' || $statusCode == 0) $statusCode = 500;
//calculate the length of the header and extract it
$headerLength = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
$rawHeaders = substr($rawResponse, 0, $headerLength);