Skip to content
This repository was archived by the owner on Jan 6, 2024. It is now read-only.

Commit 0983218

Browse files
committed
Set state to rejected when the rejection callback is called
1 parent 0bd4f75 commit 0983218

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Guzzle6Promise.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ public function __construct(PromiseInterface $promise, RequestInterface $request
5555

5656
return $response;
5757
}, function ($reason) use ($request) {
58+
$this->state = self::REJECTED;
59+
5860
if ($reason instanceof HttplugException) {
59-
$this->state = self::REJECTED;
6061
$this->exception = $reason;
6162
} elseif ($reason instanceof GuzzleExceptions\GuzzleException) {
62-
$this->state = self::REJECTED;
6363
$this->exception = $this->handleException($reason, $request);
6464
} elseif ($reason instanceof \Exception) {
6565
throw new \RuntimeException('Invalid exception returned from Guzzle6', 0, $reason);

0 commit comments

Comments
 (0)