Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeException error #89

Open
darkvovich opened this issue Oct 31, 2021 · 0 comments
Open

RuntimeException error #89

darkvovich opened this issue Oct 31, 2021 · 0 comments

Comments

@darkvovich
Copy link

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());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant