From 6a6f645b2a8233c44540b943962c7f82cb073ea1 Mon Sep 17 00:00:00 2001 From: Thomas Schaaf Date: Tue, 8 Dec 2015 08:15:12 +0100 Subject: [PATCH] Don't catch the Guzzle Exceptions --- plivo.php | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/plivo.php b/plivo.php index 6b1d91da..40d5555d 100644 --- a/plivo.php +++ b/plivo.php @@ -46,33 +46,19 @@ private function request($method, $path, $params = array()) { if (!strcmp($method, "POST")) { $body = json_encode($params, JSON_FORCE_OBJECT); - try { - $response = $client->post('', array( + + $response = $client->post('', array( 'headers' => [ 'Content-type' => 'application/json'], 'body' => $body, )); - } catch (ClientException $e) { - echo $e->getRequest(); - echo $e->getResponse(); - } } else if (!strcmp($method, "GET")) { - try { - $response = $client->get('', array( + $response = $client->get('', array( 'query' => $params, )); - } catch (ClientException $e) { - echo $e->getRequest(); - echo $e->getResponse(); - } } else if (!strcmp($method, "DELETE")) { - try { - $response = $client->delete('', array( + $response = $client->delete('', array( 'query' => $params, )); - } catch (ClientException $e) { - echo $e->getRequest(); - echo $e->getResponse(); - } } $responseData = json_decode($response->getBody(), true); $status = $response->getStatusCode();