Problem
The batchSend implementation of the Guzzle6Adapter never invoke the callback defined in the rejected option key when the request fails.
As a callback is set instead by the adapter, it is impossible to process errors when a call fails.
How to reproduce
- Given : 2 requests, 1 success & 1 error
- Expected : Both messages are displayed, means both callbacks were invoked
- Actual : Only the
fulfilled callback ("success") is reached
<?php
$halClient = (new Client())->getHalClient()->withToken('<api_key>');
$requests['success'] = $halClient->createRequest('GET', '/v1/ping'); // 200 here
$requests['error'] = $halClient->createRequest('GET', '/v1/pong'); // 404 here
$halClient->batchSend($requests, [
'fulfilled' => function($response, $id) {
echo "$id : OK\n";
},
'rejected' => function($exception, $id) {
echo "$id : NOT OK\n";
}
]);
Problem
The
batchSendimplementation of theGuzzle6Adapternever invoke the callback defined in therejectedoption key when the request fails.As a callback is set instead by the adapter, it is impossible to process errors when a call fails.
How to reproduce
fulfilledcallback ("success") is reached