Skip to content

Commit

Permalink
Output json_last_error_msg instead of json_last_error
Browse files Browse the repository at this point in the history
  • Loading branch information
jkrzefski committed Jul 16, 2020
1 parent bed7bc1 commit 5bebe51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Elasticsearch/Serializers/SmartSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function serialize($data): string
} else {
$data = json_encode($data, JSON_PRESERVE_ZERO_FRACTION + JSON_INVALID_UTF8_SUBSTITUTE);
if ($data === false) {
throw new Exceptions\RuntimeException("Failed to JSON encode: ".json_last_error());
throw new Exceptions\RuntimeException("Failed to JSON encode: ".json_last_error_msg());
}
if ($data === '[]') {
return '{}';
Expand Down

0 comments on commit 5bebe51

Please sign in to comment.