Skip to content
This repository has been archived by the owner. It is now read-only.

Throw exception on curl exec error #2

Merged
merged 1 commit into from May 15, 2013
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Throw exception on curl exec error

  • Loading branch information
siboulet committed Mar 7, 2013
commit b30a834d5634f53b4438a1f5645a41bf085cfd43
@@ -76,10 +76,13 @@ public function makeRequest($path, $params = null, $method = 'GET') {
}

$result = curl_exec($curl);
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);

if (!$result) {
throw new LogglyException(curl_error($curl));
}

$json = json_decode($result, true);
if (!$json && $result) {
if (!$json) {
# API is inconsistent
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($status >= 200 && $status <= 299) {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.