Skip to content

Commit

Permalink
Merge pull request #338 from 8p/replace_exception_by_throwable
Browse files Browse the repository at this point in the history
Replace exception argument by throwable
  • Loading branch information
gregurco authored Dec 4, 2023
2 parents 31df3ad + df9b34c commit 3e936c5
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 @@ -4,14 +4,14 @@

use EightPoints\Bundle\GuzzleBundle\Events\Event;
use EightPoints\Bundle\GuzzleBundle\Events\PostTransactionEvent;
use Exception;
use GuzzleHttp\Exception\RequestException;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface as ContractsEventDispatcherInterface;
use EightPoints\Bundle\GuzzleBundle\Events\GuzzleEvents;
use EightPoints\Bundle\GuzzleBundle\Events\PreTransactionEvent;
use Throwable;

/**
* Dispatches an Event using the Symfony Event Dispatcher.
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 3e936c5

Please sign in to comment.