Record in the logs the contents of any Invalid JSON messages

This commit is contained in:
Deon George 2022-06-10 09:34:09 +10:00
parent 1cbab6df2a
commit b69220b1ce
1 changed files with 1 additions and 1 deletions

View File

@ -33,7 +33,7 @@ class Payload implements \ArrayAccess, \JsonSerializable
$data = json_decode((string)$json,true);
if (json_last_error() !== JSON_ERROR_NONE || (! is_array($data))) {
throw new \UnexpectedValueException('Invalid JSON message.');
throw new \UnexpectedValueException('Invalid JSON message:'.serialize($data));
}
return new static($data);