protected function addError(\Exception $exception)
    {
        $this->errorList[$exception->getCode()] = [
            'message'   => $exception->getMessage(),
            'line'      => $exception->getLine(),
            'file'      => $exception->getFile(),
            'trace'     => $exception->getTraceAsString(),
        ];
        $this->hasErrors = true;

        return $this;
    }
protected function addError(\Exception $exception)
    {
        $this->errorList[$exception->getCode()] = [
            'message'   => $exception->getMessage(),
            'line'      => $exception->getLine(),
            'file'      => $exception->getFile(),
            'trace'     => $exception->getTraceAsString(),
        ];
        $this->hasErrors = true;

        return $this;
    }
protected function addError ( \ Exception $ exception ) { $ this -> errorList [ $ exception -> getCode ( ) ] = [ 'message' => $ exception -> getMessage ( ) , 'line' => $ exception -> getLine ( ) , 'file' => $ exception -> getFile ( ) , 'trace' => $ exception -> getTraceAsString ( ) , ] ; $ this -> hasErrors = true ; return $ this ; }
add new error to list

@param \Exception $exception
@return $this
add new error to list