In NotionException::fromResponse(), array_key_exists throws an exception when $responseBody is null, in the statement if (array_key_exists("code", $responseBody)).
To Reproduce
This cropped up on our production site but not sure how to reproduce it. It happened during a call to Notion::pages()->update($page);, and when the call fails inside Endpoint::patch() and an attempt is made to throw a NotionException.
Laravel 9. PHP 8.
Expected behavior
$responseBody is check to make sure it isn't null before calling array_keys with it.
Describe the bug
In NotionException::fromResponse(),
array_key_exists
throws an exception when $responseBody is null, in the statementif (array_key_exists("code", $responseBody))
.To Reproduce
This cropped up on our production site but not sure how to reproduce it. It happened during a call to
Notion::pages()->update($page);
, and when the call fails insideEndpoint::patch()
and an attempt is made to throw a NotionException.Laravel 9. PHP 8.
Expected behavior
$responseBody
is check to make sure it isn't null before calling array_keys with it.Exceptions