We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7bbe462 commit bf567cbCopy full SHA for bf567cb
src/Proxy.php
@@ -2,6 +2,7 @@
2
3
namespace Proxy;
4
5
+use GuzzleHttp\Exception\ClientException;
6
use Proxy\Adapter\AdapterInterface;
7
use Proxy\Exception\UnexpectedValueException;
8
use Psr\Http\Message\RequestInterface;
@@ -79,7 +80,11 @@ public function to($target)
79
80
$stack = $this->filters;
81
82
$stack[] = function (RequestInterface $request, ResponseInterface $response, callable $next) {
- $response = $this->adapter->send($request);
83
+ try {
84
+ $response = $this->adapter->send($request);
85
+ } catch (ClientException $ex) {
86
+ $response = $ex->getResponse();
87
+ }
88
89
return $next($request, $response);
90
};
0 commit comments