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

Commit 534dfd5

Browse files
committed
Store the exception in the promise regardless its type
1 parent 0983218 commit 534dfd5

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
@@ -62,9 +62,9 @@ public function __construct(PromiseInterface $promise, RequestInterface $request
6262
} elseif ($reason instanceof GuzzleExceptions\GuzzleException) {
6363
$this->exception = $this->handleException($reason, $request);
6464
} elseif ($reason instanceof \Exception) {
65-
throw new \RuntimeException('Invalid exception returned from Guzzle6', 0, $reason);
65+
$this->exception = new \RuntimeException('Invalid exception returned from Guzzle6', 0, $reason);
6666
} else {
67-
throw new \UnexpectedValueException('Reason returned from Guzzle6 must be an Exception', 0, $reason);
67+
$this->exception = new \UnexpectedValueException('Reason returned from Guzzle6 must be an Exception', 0, $reason);
6868
}
6969

7070
throw $this->exception;

0 commit comments

Comments
 (0)