src/JsonException.php
public static function fromJsonError(int $jsonError, $failedValue): self
    {
        return new static(static::getExceptionMessage($jsonError), $jsonError, null, $failedValue);
    }
public static function fromJsonError(int $jsonError, $failedValue): self
    {
        return new static(static::getExceptionMessage($jsonError), $jsonError, null, $failedValue);
    }
public static function fromJsonError ( int $ jsonError , $ failedValue ) : self { return new static ( static :: getExceptionMessage ( $ jsonError ) , $ jsonError , null , $ failedValue ) ; }
Creates a new exception object based on the JSON error code.

@param int $jsonError
the JSON error code.
@param $failedValue
The value that failed to parse or encode.
@return JsonException
A new exception object.
Creates a new exception object based on the JSON error code .