Skip to content

Commit

Permalink
Remove invalid method call
Browse files Browse the repository at this point in the history
When a connection fails, there cannot be a response: the client would
have to be connected to get one. Therefore, it would make no sense to
have a hasResponse() method on ConnectException.
  • Loading branch information
greg0ire committed Apr 20, 2021
1 parent 58ad00a commit 12def50
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions src/Http/GuzzleHttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,13 @@ public function sendRequest(RequestInterface $request, $timeout, $connectTimeout
);
}
} catch (ConnectException $e) {
if ($e->hasResponse()) {
return $e->getResponse();
} else {
return new Response(
0,
[],
null,
'1.1',
$e->getMessage()
);
}
return new Response(
0,
[],
null,
'1.1',
$e->getMessage()
);
}

return $response;
Expand Down

0 comments on commit 12def50

Please sign in to comment.