@@ -31,18 +31,19 @@ class JsonErrorException extends \Exception implements ElasticsearchException
31
31
JSON_ERROR_CTRL_CHAR => 'Control character error, possibly incorrectly encoded ' ,
32
32
JSON_ERROR_SYNTAX => 'Syntax error ' ,
33
33
JSON_ERROR_UTF8 => 'Malformed UTF-8 characters, possibly incorrectly encoded ' ,
34
+ JSON_ERROR_RECURSION => 'One or more recursive references in the value to be encoded ' ,
35
+ JSON_ERROR_INF_OR_NAN => 'One or more NAN or INF values in the value to be encoded ' ,
36
+ JSON_ERROR_UNSUPPORTED_TYPE => 'A value of a type that cannot be encoded was given ' ,
34
37
35
- // JSON_ERROR_* constant values that are available on PHP >= 5.5.0
36
- 6 => 'One or more recursive references in the value to be encoded ' ,
37
- 7 => 'One or more NAN or INF values in the value to be encoded ' ,
38
- 8 => 'A value of a type that cannot be encoded was given ' ,
39
-
38
+ // JSON_ERROR_* constant values that are available on PHP >= 7.0
39
+ 9 => 'Decoding of value would result in invalid PHP property name ' , //JSON_ERROR_INVALID_PROPERTY_NAME
40
+ 10 => 'Attempted to decode nonexistent UTF-16 code-point ' //JSON_ERROR_UTF16
40
41
);
41
42
42
43
public function __construct ($ code , $ input , $ result , $ previous = null )
43
44
{
44
45
if (isset (self ::$ messages [$ code ]) !== true ) {
45
- throw new \InvalidArgumentException (sprintf ('%d is not a valid JSON error code. ' , $ code ));
46
+ throw new \InvalidArgumentException (sprintf ('Encountered unknown JSON error code: [%d] ' , $ code ));
46
47
}
47
48
48
49
parent ::__construct (self ::$ messages [$ code ], $ code , $ previous );
0 commit comments