Skip to content

Commit

Permalink
Store the exception in the promise regardless its type
Browse files Browse the repository at this point in the history
  • Loading branch information
sagikazarmark committed Dec 22, 2015
1 parent 0983218 commit 534dfd5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Guzzle6Promise.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ public function __construct(PromiseInterface $promise, RequestInterface $request
} elseif ($reason instanceof GuzzleExceptions\GuzzleException) {
$this->exception = $this->handleException($reason, $request);
} elseif ($reason instanceof \Exception) {
throw new \RuntimeException('Invalid exception returned from Guzzle6', 0, $reason);
$this->exception = new \RuntimeException('Invalid exception returned from Guzzle6', 0, $reason);
} else {
throw new \UnexpectedValueException('Reason returned from Guzzle6 must be an Exception', 0, $reason);
$this->exception = new \UnexpectedValueException('Reason returned from Guzzle6 must be an Exception', 0, $reason);
}

throw $this->exception;
Expand Down

0 comments on commit 534dfd5

Please sign in to comment.