src/AbstractJsonEncoder.php
private function addError($message)
    {
        $errorMessage = sprintf('Line %d, column %d: %s', $this->line, $this->column, $message);
        $this->errors[] = $errorMessage;

        if ($this->options & JSON_PARTIAL_OUTPUT_ON_ERROR) {
            return;
        }

        $this->stack = [];
        $this->step = null;

        throw new EncodingException($errorMessage);
    }
private function addError($message)
    {
        $errorMessage = sprintf('Line %d, column %d: %s', $this->line, $this->column, $message);
        $this->errors[] = $errorMessage;

        if ($this->options & JSON_PARTIAL_OUTPUT_ON_ERROR) {
            return;
        }

        $this->stack = [];
        $this->step = null;

        throw new EncodingException($errorMessage);
    }
private function addError ( $ message ) { $ errorMessage = sprintf ( 'Line %d, column %d: %s' , $ this -> line , $ this -> column , $ message ) ; $ this -> errors [ ] = $ errorMessage ; if ( $ this -> options & JSON_PARTIAL_OUTPUT_ON_ERROR ) { return ; } $ this -> stack = [ ] ; $ this -> step = null ; throw new EncodingException ( $ errorMessage ) ; }
Adds an JSON encoding error to the list of errors.
@param string $message The error message to add
@throws EncodingException If the encoding should not continue due to the error
Adds an JSON encoding error to the list of errors .