mirror of
https://github.com/guzzle/guzzle.git
synced 2025-02-24 18:13:00 +01:00
Improving HttpErrorPlugin
This commit is contained in:
parent
6daa24c0fa
commit
ad96821214
@ -26,7 +26,7 @@ class HttpErrorPlugin implements EventSubscriberInterface
|
||||
{
|
||||
$code = (string) $event->getResponse()->getStatusCode();
|
||||
// Throw an exception for an unsuccessful response
|
||||
if ($code[0] != '2' && $code != 304) {
|
||||
if ($code[0] !== '2' && $code !== '304') {
|
||||
$event->intercept(RequestException::create($event->getRequest(), $event->getResponse()));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user