It looks like some 4XX errors returned from Citadel sometimes don't contain a JSON response and have a blank response instead. I'm not sure what 4XX code this happens on but in the instance I found it's when we pass a token with the value undefined.
The code expects a JSON response with error details. However because there is none it throws a MalformedPayloadException which is confusing
|
if ($statusCode >= 400) { |
|
ExceptionFactory::generateExceptionFromResponse($response); |
|
} |
It looks like some 4XX errors returned from Citadel sometimes don't contain a JSON response and have a blank response instead. I'm not sure what 4XX code this happens on but in the instance I found it's when we pass a token with the value
undefined.The code expects a JSON response with error details. However because there is none it throws a
MalformedPayloadExceptionwhich is confusingcitadel-php/src/Client.php
Lines 127 to 129 in 7eb2d66