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

Commit 7191ea0

Browse files
committed
Fix for Promise\settle(). #49
1 parent 54181ff commit 7191ea0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Promise.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
use GuzzleHttp\Exception as GuzzleExceptions;
66
use GuzzleHttp\Promise\PromiseInterface;
7+
use function GuzzleHttp\Promise\promise_for;
8+
use function GuzzleHttp\Promise\rejection_for;
79
use Http\Client\Exception as HttplugException;
810
use Http\Promise\Promise as HttpPromise;
911
use Psr\Http\Message\RequestInterface;
@@ -96,10 +98,10 @@ public function wait($unwrap = true)
9698

9799
if ($unwrap) {
98100
if ($this->getState() == self::REJECTED) {
99-
throw $this->exception;
101+
return rejection_for($this->exception);
100102
}
101103

102-
return $this->response;
104+
return promise_for($this->response);
103105
}
104106
}
105107

0 commit comments

Comments
 (0)