snowcap / Emarsys

PHP HTTP client for Emarsys webservice
MIT License
39 stars 37 forks source link

5xx error not reported correctly #49

Open dave470003 opened 5 years ago

dave470003 commented 5 years ago

Even though their API says they'll only return JSON, they will sometimes return HTML if it's a 500 error. In this situation, we should throw a different error message rather than falling back to 'JSON response could not be decoded.'

https://github.com/snowcap/Emarsys/blob/3ca864f658a26f6da2c0b7d9037f5b384e0c71c7/src/Snowcap/Emarsys/Client.php#L914