File tree Expand file tree Collapse file tree 4 files changed +8
-10
lines changed Expand file tree Collapse file tree 4 files changed +8
-10
lines changed Original file line number Diff line number Diff line change 1111
1212namespace FOS \HttpCache \Exception ;
1313
14- use Http \Client \Exception \RequestException ;
14+ use Http \Client \Exception \NetworkException ;
1515
1616/**
1717 * Thrown when a request to the reverse caching proxy fails to establish a
2020class ProxyUnreachableException extends \RuntimeException implements HttpCacheException
2121{
2222 /**
23- * @param RequestException $requestException
24- *
2523 * @return ProxyUnreachableException
2624 */
27- public static function proxyUnreachable (RequestException $ requestException )
25+ public static function proxyUnreachable (NetworkException $ requestException )
2826 {
2927 $ message = sprintf (
3028 'Request to caching proxy at %s failed with message "%s" ' ,
Original file line number Diff line number Diff line change 2020use Http \Client \Common \Plugin \ErrorPlugin ;
2121use Http \Client \Common \PluginClient ;
2222use Http \Client \Exception \HttpException ;
23- use Http \Client \Exception \RequestException ;
23+ use Http \Client \Exception \NetworkException ;
2424use Http \Client \HttpAsyncClient ;
2525use Http \Discovery \HttpAsyncClientDiscovery ;
2626use Http \Discovery \UriFactoryDiscovery ;
@@ -152,7 +152,7 @@ public function flush()
152152 $ promise ->wait ();
153153 } catch (HttpException $ exception ) {
154154 $ exceptions ->add (ProxyResponseException::proxyResponse ($ exception ));
155- } catch (RequestException $ exception ) {
155+ } catch (NetworkException $ exception ) {
156156 $ exceptions ->add (ProxyUnreachableException::proxyUnreachable ($ exception ));
157157 } catch (\Exception $ exception ) {
158158 // @codeCoverageIgnoreStart
Original file line number Diff line number Diff line change 2424use FOS \HttpCache \ProxyClient \ProxyClient ;
2525use FOS \HttpCache \ProxyClient \Varnish ;
2626use Http \Client \Exception \HttpException ;
27- use Http \Client \Exception \RequestException ;
27+ use Http \Client \Exception \NetworkException ;
2828use Mockery \Adapter \Phpunit \MockeryPHPUnitIntegration ;
2929use Mockery \MockInterface ;
3030use PHPUnit \Framework \TestCase ;
@@ -211,7 +211,7 @@ public function testProxyClientExceptionsAreLogged()
211211 $ failedRequest = \Mockery::mock (RequestInterface::class)
212212 ->shouldReceive ('getHeaderLine ' )->with ('Host ' )->andReturn ('127.0.0.1 ' )
213213 ->getMock ();
214- $ clientException = new RequestException ('Couldn \'t connect to host ' , $ failedRequest );
214+ $ clientException = new NetworkException ('Couldn \'t connect to host ' , $ failedRequest );
215215
216216 $ unreachableException = ProxyUnreachableException::proxyUnreachable ($ clientException );
217217
Original file line number Diff line number Diff line change 1717use FOS \HttpCache \Exception \ProxyUnreachableException ;
1818use FOS \HttpCache \ProxyClient \HttpDispatcher ;
1919use Http \Client \Exception \HttpException ;
20- use Http \Client \Exception \RequestException ;
20+ use Http \Client \Exception \NetworkException ;
2121use Http \Client \HttpAsyncClient ;
2222use Http \Discovery \MessageFactoryDiscovery ;
2323use Http \Discovery \UriFactoryDiscovery ;
@@ -133,7 +133,7 @@ public function exceptionProvider()
133133 '400 ' ,
134134 ],
135135 [
136- new RequestException ('test ' , $ request ),
136+ new NetworkException ('test ' , $ request ),
137137 ProxyUnreachableException::class,
138138 'bla.com ' ,
139139 ],
You can’t perform that action at this time.
0 commit comments