Skip to content

Commit 2a243f5

Browse files
committed
Updated exceptions
1 parent 072d2c3 commit 2a243f5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Collector/Formatter.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ public function __construct(MessageFormatter $formatter, CurlCommandFormatter $c
4949
*/
5050
public function formatException(Exception $exception)
5151
{
52-
if ($exception instanceof HttpException) {
52+
if ($exception instanceof HttpException || $exception instanceof \Psr\Http\Client\RequestExceptionInterface) {
5353
return $this->formatter->formatResponse($exception->getResponse());
5454
}
5555

56-
if ($exception instanceof TransferException) {
56+
if ($exception instanceof TransferException || $exception instanceof \Psr\Http\Client\NetworkExceptionInterface) {
5757
return sprintf('Transfer error: %s', $exception->getMessage());
5858
}
5959

Collector/ProfileClient.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ private function collectResponseInformations(ResponseInterface $response, Stopwa
182182
*/
183183
private function collectExceptionInformations(\Exception $exception, StopwatchEvent $event, Stack $stack)
184184
{
185-
if ($exception instanceof HttpException) {
185+
if ($exception instanceof HttpException || $exception instanceof \Psr\Http\Client\RequestExceptionInterface) {
186186
$this->collectResponseInformations($exception->getResponse(), $event, $stack);
187187
}
188188

0 commit comments

Comments
 (0)