RuntimeException error
darkvovich opened this issue · 0 comments
If you get non-existent card
$getCard = $client->api('card')->show('123456', ['fields' => 'all', 'customFieldItems' => true]);
You get Fatal Error Instead of correct throw RuntimeException:
Fatal error: Uncaught Error: Cannot use object of type GuzzleHttp\Stream\Stream as array in ... /vendor/matteocacciola/php-trello-api/lib/Trello/HttpClient/Subscriber/ErrorSubscriber.php on line 89
Solution was go to file /vendor/matteocacciola/php-trello-api/lib/Trello/HttpClient/Subscriber/ErrorSubscriber.php on line 89 and change this line:
throw new RuntimeException(isset($content['message']) ? $content['message'] : $content, $response->getStatusCode());
to new:
throw new RuntimeException(is_array($content) && isset($content['message']) ? $content['message'] : $content, $response->getStatusCode());