Skip to content

Commit

Permalink
Remove references to GuzzleHttp\Promise\rejection_for (Guzzle 7.7 com…
Browse files Browse the repository at this point in the history
…patibility)

Fixes: gmponos#48
  • Loading branch information
mwolff-fn committed Aug 2, 2023
1 parent 8784459 commit 692bdf1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/LogMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@ private function handleFailure(RequestInterface $request, array $options): calla
return function (\Exception $reason) use ($request, $options) {
if ($reason instanceof RequestException && $reason->hasResponse() === true) {
$this->handler->log($this->logger, $request, $reason->getResponse(), $reason, $this->stats, $options);
return \GuzzleHttp\Promise\rejection_for($reason);
return new \GuzzleHttp\Promise\RejectedPromise($reason);
}

$this->handler->log($this->logger, $request, null, $reason, $this->stats, $options);
return \GuzzleHttp\Promise\rejection_for($reason);
return new \GuzzleHttp\Promise\RejectedPromise($reason);
};
}

Expand Down

0 comments on commit 692bdf1

Please sign in to comment.