Skip to content

RuntimeException error #89

@darkvovich

Description

@darkvovich

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions