Skip to content

Commit

Permalink
[HttpClient] Adjust JsonMockResponse exception
Browse files Browse the repository at this point in the history
  • Loading branch information
alamirault committed Apr 23, 2023
1 parent 6c28196 commit 48a953f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function __construct(mixed $body = [], array $info = [])
try {
$json = json_encode($body, \JSON_THROW_ON_ERROR);
} catch (\JsonException $e) {
throw new InvalidArgumentException('JSON encoding failed: '.$e->getMessage(), $e->getCode());
throw new InvalidArgumentException('JSON encoding failed: '.$e->getMessage(), $e->getCode(), $e);
}

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

0 comments on commit 48a953f

Please sign in to comment.