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.'
|
throw new ServerException("JSON response could not be decoded:\n" . json_last_error_msg()); |
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.'
Emarsys/src/Snowcap/Emarsys/Client.php
Line 914 in 3ca864f