Closed BoShurik closed 7 years ago
Thanks for your report. 5.4 was removed a couple of days ago. Are you sure that you are using this version? We have this "feature" in v6.0. So maybe the title should be changed.
Just update to 5.4 version https://packagist.org/packages/eightpoints/guzzle-bundle
In 6.0 the problem still exists
Mhhh, I removed this version from packagist, but when clicking update it will be reactivated, strange. Sorry for the trouble. I will take a look into this later today.
@florianpreusner looks like you must remove it from releases
@BoShurik I can' reproduce your issue. "sendRequest" is a method provided by your own class, or? Inside you are using \GuzzleHttp\Client->request()?
When I'm getting a 401 I get the exception (GuzzleHttp\Exception\ClientException) and can catch it. That works with the modification by @thomasjohansen and also without. So I can't see a change in the behavior. Maybe you should adjust your class that will be catched. I can't see a place where "HttpException" will be thrown.
$client = $this->get('guzzle.client.test_client');
try {
$response = $client->request('GET', 'https://httpbin.org/status/401');
} catch(\GuzzleHttp\Exception\ClientException $e) {
// here we go
}
Forgot to mention that I use httplug
and php-http/guzzle6-adapter
HttpException
is Http\Client\Exception\HttpException
Can it be that my latest PR #115 fixed this issue (see #114)? I had the same problem of not getting an exception. Try to use the master branch.
It works! Can you add tag?
Just released v6.0.1 https://github.com/8p/GuzzleBundle/releases/tag/v6.0.1
This code
no longer catch an 401 exception (may be other exceptions too) The problem is in this commit by @thomasjohansen