@@ -67,7 +67,7 @@ Like in case of the ``$next`` callable, you must pass the ``$request`` as the fi
67
67
or you will end up in an infinite execution loop.
68
68
69
69
The ``$next `` and ``$first `` callables will return a :doc: `/components/promise `.
70
- You can manipulate the ``ResponseInterface `` or the ``Exception `` by using the
70
+ You can manipulate the ``Psr\Http\Message\ ResponseInterface `` or the ``Http\Client\ Exception `` by using the
71
71
``then `` method of the promise::
72
72
73
73
public function handleRequest(RequestInterface $request, callable $next, callable $first)
@@ -76,7 +76,7 @@ You can manipulate the ``ResponseInterface`` or the ``Exception`` by using the
76
76
77
77
return $next($request)->then(function (ResponseInterface $response) {
78
78
return $response->withHeader('MyResponseHeader', 'value');
79
- }, function (Exception $exception) {
79
+ }, function (\Http\Client\ Exception $exception) {
80
80
echo $exception->getMessage();
81
81
82
82
throw $exception;
@@ -89,6 +89,11 @@ You can manipulate the ``ResponseInterface`` or the ``Exception`` by using the
89
89
PSR _ is released. Once it is out, we will use this PSR in HTTPlug and
90
90
deprecate the old contract.
91
91
92
+ .. warning ::
93
+
94
+ If a plugin throws an exception that does not implement ``Http\Client\Exception ``
95
+ it will break the plugin chain.
96
+
92
97
To better understand the whole process check existing implementations in the
93
98
`client-common package `_.
94
99
0 commit comments