Skip to content

Commit 1eacc3a

Browse files
committed
don't call getResponse() on RequestExceptionInterface
1 parent f94de3b commit 1eacc3a

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

Collector/Formatter.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use Http\Message\Formatter as MessageFormatter;
99
use Http\Message\Formatter\CurlCommandFormatter;
1010
use Psr\Http\Client\NetworkExceptionInterface;
11-
use Psr\Http\Client\RequestExceptionInterface;
1211
use Psr\Http\Message\RequestInterface;
1312
use Psr\Http\Message\ResponseInterface;
1413

@@ -51,7 +50,7 @@ public function __construct(MessageFormatter $formatter, CurlCommandFormatter $c
5150
*/
5251
public function formatException(Exception $exception)
5352
{
54-
if ($exception instanceof HttpException || $exception instanceof RequestExceptionInterface) {
53+
if ($exception instanceof HttpException) {
5554
return $this->formatter->formatResponse($exception->getResponse());
5655
}
5756

Collector/ProfileClient.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use Http\Client\HttpAsyncClient;
99
use Http\Client\HttpClient;
1010
use Psr\Http\Client\ClientInterface;
11-
use Psr\Http\Client\RequestExceptionInterface;
1211
use Psr\Http\Message\RequestInterface;
1312
use Psr\Http\Message\ResponseInterface;
1413
use Symfony\Component\Stopwatch\Stopwatch;
@@ -183,7 +182,7 @@ private function collectResponseInformations(ResponseInterface $response, Stopwa
183182
*/
184183
private function collectExceptionInformations(\Exception $exception, StopwatchEvent $event, Stack $stack)
185184
{
186-
if ($exception instanceof HttpException || $exception instanceof RequestExceptionInterface) {
185+
if ($exception instanceof HttpException) {
187186
$this->collectResponseInformations($exception->getResponse(), $event, $stack);
188187
}
189188

0 commit comments

Comments
 (0)