Skip to content

Commit 54e26a9

Browse files
committed
[HttpClient] Adjust JsonMockResponse exception
1 parent 3491918 commit 54e26a9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Response/JsonMockResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function __construct(mixed $body = [], array $info = [])
2020
try {
2121
$json = json_encode($body, \JSON_THROW_ON_ERROR);
2222
} catch (\JsonException $e) {
23-
throw new InvalidArgumentException('JSON encoding failed: '.$e->getMessage(), $e->getCode());
23+
throw new InvalidArgumentException('JSON encoding failed: '.$e->getMessage(), $e->getCode(), $e);
2424
}
2525

2626
$info['response_headers']['content-type'] ??= 'application/json';

0 commit comments

Comments
 (0)