Skip to content

Commit 56264b1

Browse files
committed
Make sure we do not break BC
1 parent 3ac1fba commit 56264b1

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/Plugin/HistoryPlugin.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Http\Client\Common\Plugin;
44

55
use Http\Client\Common\Plugin;
6+
use Http\Client\Exception;
67
use Psr\Http\Message\RequestInterface;
78
use Psr\Http\Message\ResponseInterface;
89

@@ -40,7 +41,9 @@ public function handleRequest(RequestInterface $request, callable $next, callabl
4041

4142
return $response;
4243
}, function (\Exception $exception) use ($request, $journal) {
43-
$journal->addFailure($request, $exception);
44+
if ($exception instanceof Exception) {
45+
$journal->addFailure($request, $exception);
46+
}
4447

4548
throw $exception;
4649
});

src/Plugin/Journal.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Http\Client\Common\Plugin;
44

5+
use Http\Client\Exception;
56
use Psr\Http\Message\RequestInterface;
67
use Psr\Http\Message\ResponseInterface;
78

@@ -24,7 +25,7 @@ public function addSuccess(RequestInterface $request, ResponseInterface $respons
2425
* Record a failed call.
2526
*
2627
* @param RequestInterface $request Request use to make the call
27-
* @param \Exception $exception Exception returned by the call
28+
* @param Exception $exception Exception returned by the call
2829
*/
29-
public function addFailure(RequestInterface $request, \Exception $exception);
30+
public function addFailure(RequestInterface $request, Exception $exception);
3031
}

0 commit comments

Comments
 (0)