Skip to content

Commit

Permalink
Process Throwable reason without useless TypeError (#309)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregurco authored Jul 29, 2020
1 parent 5b4e2e4 commit 9e976d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Middleware/EventDispatchMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use EightPoints\Bundle\GuzzleBundle\Events\GuzzleEvents;
use EightPoints\Bundle\GuzzleBundle\Events\PostTransactionEvent;
use EightPoints\Bundle\GuzzleBundle\Events\PreTransactionEvent;
use Exception;
use Throwable;
use GuzzleHttp\Exception\RequestException;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
Expand Down Expand Up @@ -70,7 +70,7 @@ function (ResponseInterface $response) {
// Continue down the chain.
return $postTransactionEvent->getTransaction();
},
function (Exception $reason) {
function (Throwable $reason) {
// Get the response. The response in a RequestException can be null too.
$response = $reason instanceof RequestException ? $reason->getResponse() : null;

Expand Down

0 comments on commit 9e976d2

Please sign in to comment.