Skip to content

Commit a90148a

Browse files
authored
Output json_last_error_msg instead of json_last_error (#1045)
1 parent 754686c commit a90148a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Elasticsearch/Serializers/SmartSerializer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function serialize($data): string
3333
} else {
3434
$data = json_encode($data, JSON_PRESERVE_ZERO_FRACTION + JSON_INVALID_UTF8_SUBSTITUTE);
3535
if ($data === false) {
36-
throw new Exceptions\RuntimeException("Failed to JSON encode: ".json_last_error());
36+
throw new Exceptions\RuntimeException("Failed to JSON encode: ".json_last_error_msg());
3737
}
3838
if ($data === '[]') {
3939
return '{}';

0 commit comments

Comments
 (0)