diff --git a/src/Client.php b/src/Client.php index 40f91f3..f65f088 100644 --- a/src/Client.php +++ b/src/Client.php @@ -284,13 +284,21 @@ public function getData($uri, $jsonData = null) } $json = curl_exec($ch); + + if($json === false) + { + throw new RuntimeException('Curl error: '.curl_error($ch)); + } + $info = curl_getinfo($ch); $code = $this->getStatusCode($ch); if ($this->timeDataCollector) { $this->timeDataCollector->stopMeasure('getData'); } + + if (200 != $code) { - throw new RuntimeException('HTTP Status code: '.$code); + throw new RuntimeException('HTTP Status code: '.$code.'message: '.$json); } $data = @json_decode($json, true); curl_close($ch);