kriswallsmith / Buzz

PHP's lightweight HTTP client
MIT License
1.92k stars 250 forks source link

When header are invalid, exception is not catched #399

Closed lyrixx closed 4 years ago

lyrixx commented 5 years ago

hello

Here is the reproducer:

use Buzz\Client\MultiCurl;
use Nyholm\Psr7\Factory\Psr17Factory;
use Nyholm\Psr7\Request;

require __DIR__.'/vendor/autoload.php';

$client = new MultiCurl(new Psr17Factory(), [
]);

$client->sendAsyncRequest($a = new Request('get', 'https://www.elysee.fr/'), ['callback' => function($request, $response, $exception) {
    dump([$request, $response, $exception]);
}]);

while (true) {
    $client->proceed();
    echo '.';
    usleep(100000);
}

I'm expecting that my callback will be called. But instead an exception is bubbled from $client->proceed()

lyrixx commented 4 years ago

I don't need that anymore. Thanks