hyperwallet / php-sdk

An SDK implementation in PHP for the v4 REST APIs.
http://hyperwallet.github.io/php-sdk
MIT License
10 stars 31 forks source link

Non-json server error throws php error #37

Open Aryess opened 4 years ago

Aryess commented 4 years ago

Hi,

Found an issue with the error reporting, on this line in particular: https://github.com/hyperwallet/php-sdk/blob/225462eea684736d34ed9a837acf52631ef79394/src/Hyperwallet/Util/ApiClient.php#L178

We've got some errors returned in plain HTML, which (obviously) failed to be json_decoded

Screen Shot 2020-02-11 at 9 49 25 pm

This might be a server issue more than the SDK, however that would be good to be able to handle a non-json error as well, as for not it just throws a PHP error, and I had to manually edit the package on prod to be able to see what was happening

Cheers,

specialtactics commented 4 years ago

Yeh, we get this from time to time and it's pretty annoying.