Skip to content

Commit 03ea7cd

Browse files
authored
Add separator to exception messages (#346)
* Add separator to exception messages * Updated failing test to reflect new code changes.
1 parent c802388 commit 03ea7cd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Messages/ExceptionErrorHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ public function __invoke(ResponseInterface $response, RequestInterface $request)
4444
}
4545

4646
if ($statusCode >= 500 && $statusCode <= 599) {
47-
throw new ClientException\Server($responseBody['title'] . $responseBody['detail']);
47+
throw new ClientException\Server($responseBody['title'] . ': ' . $responseBody['detail']);
4848
}
4949

50-
throw new ClientException\Request($responseBody['title'] . $responseBody['detail']);
50+
throw new ClientException\Request($responseBody['title'] . ': ' . $responseBody['detail']);
5151
}
5252
}

test/Messages/ClientTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ public function testCanSendViberText(): void
634634
public function testThrowsRequestErrorOnBadRequest(): void
635635
{
636636
$this->expectException(Client\Exception\Request::class);
637-
$this->expectErrorMessage('The request body did not contain valid JSONUnexpected character (\'"\' (code 34)): was expecting comma to separate Object entries');
637+
$this->expectErrorMessage('The request body did not contain valid JSON: Unexpected character (\'"\' (code 34)): was expecting comma to separate Object entries');
638638

639639
$payload = [
640640
'to' => '447700900000',

0 commit comments

Comments
 (0)