Skip to content

Commit

Permalink
fix bug response event is not triggered on exception
Browse files Browse the repository at this point in the history
  • Loading branch information
rafrsr committed Sep 10, 2019
1 parent 2572d3d commit ea82131
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/GenericApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,13 @@ public function process(ApiServiceInterface $service)
$this->debugger->finishRequestProcess($debugProcess, $httpResponse);
}

$this->getEventDispatcher()->dispatch(self::EVENT_ON_RESPONSE, new OnResponseEvent($this, $service, $httpResponse));

//has pending exception
if ($exception && $exception instanceof \Exception) {
throw $exception;
}

$this->getEventDispatcher()->dispatch(self::EVENT_ON_RESPONSE, new OnResponseEvent($this, $service, $httpResponse));

if ($responseParser = $requestBuilder->getResponseParser()) {
if ($newResponse = $responseParser->parse($httpResponse)) {
return $newResponse;
Expand Down

0 comments on commit ea82131

Please sign in to comment.