1
0
mirror of https://github.com/guzzle/guzzle.git synced 2025-02-25 02:22:57 +01:00

Improving HttpErrorPlugin

This commit is contained in:
Michael Dowling 2013-09-15 19:05:09 -07:00
parent 6daa24c0fa
commit ad96821214

View File

@ -26,7 +26,7 @@ class HttpErrorPlugin implements EventSubscriberInterface
{ {
$code = (string) $event->getResponse()->getStatusCode(); $code = (string) $event->getResponse()->getStatusCode();
// Throw an exception for an unsuccessful response // 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())); $event->intercept(RequestException::create($event->getRequest(), $event->getResponse()));
} }
} }