Skip to content

Commit 4ab0103

Browse files
authored
Fix exception creation in HttpDispatcher
1 parent 39999a6 commit 4ab0103

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ProxyClient/HttpDispatcher.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public function flush()
142142
try {
143143
$promises[] = $this->httpClient->sendAsyncRequest($proxyRequest);
144144
} catch (\Exception $e) {
145-
$exceptions->add(new InvalidArgumentException($e));
145+
$exceptions->add(new InvalidArgumentException($e->getMessage(), $e->getCode(), $e));
146146
}
147147
}
148148
}
@@ -156,7 +156,7 @@ public function flush()
156156
$exceptions->add(ProxyUnreachableException::proxyUnreachable($exception));
157157
} catch (\Exception $exception) {
158158
// @codeCoverageIgnoreStart
159-
$exceptions->add(new InvalidArgumentException($exception));
159+
$exceptions->add(new InvalidArgumentException($exception->getMessage(), $exception->getCode(), $exception));
160160
// @codeCoverageIgnoreEnd
161161
}
162162
}

0 commit comments

Comments
 (0)