Skip to content

Commit 1675dba

Browse files
committed
- adds a fallback message if PHP error message is not available
1 parent 63a1e35 commit 1675dba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ClientRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ protected function getPhpError(int $status, ?string $message = null): Response
185185
{
186186
return new ServerResponse(json_serialize([
187187
'title' => StatusCode::CODE[$status],
188-
'detail' => $message ?? \error_get_last()['message'],
188+
'detail' => $message ?? \error_get_last()['message'] ?? StatusCode::CODE[$status],
189189
'instance' => (string)$this->getUri(),
190190
'type' => 'https://httpstatuses.com/' . $status,
191191
'status' => $status,

0 commit comments

Comments
 (0)