diff --git a/index.php b/index.php index 92aa467..c9d6d7e 100644 --- a/index.php +++ b/index.php @@ -28,7 +28,12 @@ if($_SERVER["REQUEST_URI"] == '/metrics' || php_sapi_name() == 'cli') { $res = $client->request('GET', $c['http']['url'], $options); $hasresponse = true; } catch(GuzzleHttp\Exception\GuzzleException $e) { - $hasresponse = false; + if(method_exists($e, 'getResponse')) { + $res = $e->getResponse(); + $hasresponse = true; + } else { + $hasresponse = false; + } } if (isset($c['http']['data']) && $c['http']['data'] == 'responsebody') {