Skip to content

Commit

Permalink
Merge pull request #88 from agencyanalytics/cleanError
Browse files Browse the repository at this point in the history
Minor fix for error handling
  • Loading branch information
Nyholm committed Dec 31, 2015
2 parents 322b361 + 4af8334 commit b65b292
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Http/GuzzleRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

/**
Expand Down

0 comments on commit b65b292

Please sign in to comment.