From 4af83341492c6615d5754a9a00e71c3134a38e74 Mon Sep 17 00:00:00 2001 From: Eric Hacke Date: Wed, 30 Dec 2015 13:47:00 -0500 Subject: [PATCH] Force nicer error handling --- src/Http/GuzzleRequest.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Http/GuzzleRequest.php b/src/Http/GuzzleRequest.php index 355c3ce..6a68490 100644 --- a/src/Http/GuzzleRequest.php +++ b/src/Http/GuzzleRequest.php @@ -114,7 +114,11 @@ protected function parseErrorMessage(ClientException $guzzleException) }; } - return (string) $response->xml()->message; + try { + return (string)$response->xml()->message; + } catch (\Exception $ex) { + return 'Excpetion while processing error response. Error reason phrase: ' . $response->getReasonPhrase(); + } } /**