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

Commit 70f24df

Browse files
committed
Return reason if it's already a httplug exception
1 parent 4fa7901 commit 70f24df

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Guzzle6Promise.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ public function __construct(PromiseInterface $promise, RequestInterface $request
4646

4747
return $response;
4848
}, function ($reason) use ($request) {
49+
if ($reason instanceof HttplugException) {
50+
$this->state = self::REJECTED;
51+
$this->exception = $reason;
52+
53+
throw $this->exception;
54+
}
55+
4956
if (!($reason instanceof GuzzleExceptions\GuzzleException)) {
5057
throw new \RuntimeException("Invalid reason");
5158
}

0 commit comments

Comments
 (0)