Set the error item to stack.

@param (int)    $code
@param (string) $msg
@param (string) $file
@param (int)    $line
@param (string) $trace

@since 3.0.0

@return mixed
777761
protected function setParams($code, $msg, $file, $line, $trace)
    {
        return $this->stack = [
            'message'     => $msg,
            'file'        => $file,
            'line'        => $line,
            'code'        => ($code === 0) ? 404 : $code,
            'trace'       => $trace,
            'previewCode' => '',
            'editor'      => $this->setEditor,
            'editorUri'   => $this->getEditor($this->setEditor),
        ];
    }
802194
public function raise_error($code, $message)
    {
        global $__page_content, $ERROR_CODE, $ERROR_MESSAGE;

        $ERROR_CODE    = $code;
        $ERROR_MESSAGE = $message;

        include RCUBE_INSTALL_PATH . 'program/steps/utils/error.inc';
        exit;
    }
441155
public function error($message, $code = 1)
    {
        $this->logger->error($message);

        $this->write($message, self::FC_RED);
        $this->write(PHP_EOL);

        return $code;
    }
438134
private static function __triggerError($message, $file, $line, $code = 0)
        {
            if (self::$useExceptions) {
                throw new Exception($message, $file, $line, $code);
            } else {
                trigger_error($message, E_USER_WARNING);
            }
        }
554295
public static function stop($code, $msg = null)
    {
        Response::status($code, false) && self::trigger('changestatus', array($code, $msg));

        if (self::$state < 4) {
            self::$state = 4;
            self::trigger('finish');
        }

        exit;
    }
986427
public function setErrorByCode($code)
    {
        if (is_numeric($code)) {
            $code = ShopgateLibraryException::getMessageFor($code);
        }
        $this->setNotValidMessage($code);

        return $this;
    }
634007
public function displayError($code, $message, $file, $line)
    {
        $data = array();
        $data['code'] = $code;
        $data['message'] = $message;
        $data['file'] = $file;
        $data['line'] = $line;
        $data['type'] = 'error';
        $data = $this->_formatError(debug_backtrace(), $data);
        $this->render('error', $data);

    }
1269166
protected function error($code, lang_string $message) {
        if (array_key_exists($code, $this->errors)) {
            throw new coding_exception('Error code already defined');
        }
        $this->errors[$code] = $message;
    }
1010900
public function setError($code, $node, $message = '')
    {
        $this->errorCode = $code;
        $this->errorNode = $node;
        $this->errorMessage = $message;
    }
208884
public function error($str, $code = Response::STATUS_ERROR)
    {
        $this->addError(new Error($str, $code));
        Container::get('response')->setStatus($code);
        if (!Container::get('response')->isStatus(Response::STATUS_OK)) {
            $this->serve();
        }
    }
1247045
public function exception($errorMsg,  array $trace, $error = true )
    {
        $classException = "CheckoutApi_Lib_ExceptionState";

        if (class_exists($classException)) {

            /** @var CheckoutApi_Lib_ExceptionState $class */
            $class = CheckoutApi_Lib_Factory::getSingletonInstance($classException);
              
        } else {
            
            throw new Exception("Not a valid class ::  CheckoutApi_Lib_ExceptionState");
            
        } 

        $class->setLog($errorMsg,$trace,$error);

        return $class;
        
    }
878005
final public function logError($msg_code,$data = array())
    {
        self::write(self::compileMessage(self::$error_msg[$msg_code],$data), PEL_ERROR);
    }
979231
private function codeToMessage($code) {
        // get the error message belong to the given code
        switch ($code) {
            case \Th\FileDownloader::FILE_WRONG_MIME:
                $message = "File is of the wrong MIME type";
                break;
            case \Th\FileDownloader::FILE_WRONG_EXTENSION:
                $message = "File is of the wrong extension";
                break;
            case \Th\FileDownloader::INVALID_DOWNLOAD_DIR:
                $message = "User set download directory does not exist";
                break;
            default:
                $message = "Unknown download error";
                break;
        }

        // done, return the error message
        return $message;
    }
696560
public function setError($error, $code = Message::DEFAULT_ERROR_CODE)
    {
        if ($error instanceof \wf\model\Error) {
            $this->data['code']    = $error->getCode();
            $this->data['message'] = $error->getMessage();
        } elseif (is_scalar($error)) {
            $this->data['code']    = $code;
            $this->data['message'] = $error;
        } else {
            throw new \InvalidArgumentException('错误的消息类型');
        }

        $this->data['success'] = false;
	
        return $this;
    }
5671
public function getDebugError($error, $code, $path = null)
    {
        /** @var \Throwable $error */
        $line = $this->getSourceLine($error);
        if ($line === false) {
            return $error;
        }
        $source = explode("\n", $code, max(2, $line));
        array_pop($source);
        $source = implode("\n", $source);
        $pos = mb_strrpos($source, 'PUG_DEBUG:');
        if ($pos === false) {
            throw $error;
        }
        $nodeId = intval(mb_substr($source, $pos + 10, 32));
        if (!$this->debugIdExists($nodeId)) {
            throw $error;
        }
        $node = $this->getNodeFromDebugId($nodeId);
        $nodeLocation = $node->getSourceLocation();
        $location = new SourceLocation(
            ($nodeLocation ? $nodeLocation->getPath() : null) ?: $path,
            $nodeLocation ? $nodeLocation->getLine() : 0,
            $nodeLocation ? $nodeLocation->getOffset() : 0,
            $nodeLocation ? $nodeLocation->getOffsetLength() : 0
        );
        $className = $this->getOption('located_exception_class_name');

        return new $className(
            $location,
            $error->getMessage(),
            $error->getCode(),
            $error
        );
    }
1136063
protected function throwException($code, $msg)
    {
        $args = func_get_args();

        $code = array_shift($args);

        throw new \RuntimeException(call_user_func_array('sprintf', $args), $code);
    }
84657
public function setError($code, $message = '', Exception $innerException = null)
    {
        if ($code == static::ERR_NONE && !$message && $innerException === null) {
            $this->errorCode = static::ERR_NONE;
            $this->errorMessage = '';
            $this->innerException = null;
        } else {
            $code = (int) $code;
            $this->errorCode = $code === static::ERR_NONE ? static::ERR_OTHER : $code;
            $message = trim((string) $message);
            if ($message === '') {
                switch ($this->errorCode) {
                    case static::ERR_NOCURRENTLIBRARY:
                        $this->errorMessage = t("There's no current geolocation library");
                        break;
                    case static::ERR_NOCURRENTIPADDRESS:
                        $this->errorMessage = t('The IP address of the current client is not available');
                        break;
                    case static::ERR_IPNOTPUBLIC:
                        $this->errorMessage = t('The IP address is not in the public IP address ranges');
                        break;
                    case static::ERR_MISCONFIGURED:
                        $this->errorMessage = t('The geolocation library is misconfigured');
                        break;
                    case static::ERR_NETWORK:
                        $this->errorMessage = t('A network error occurred during the geolocalization');
                        break;
                    case static::ERR_LIBRARYSPECIFIC:
                        $this->errorMessage = t('An unspecified error occurred in the geolocation library');
                        break;
                    default:
                        $this->errorMessage = t('An unexpected error occurred in the geolocation library');
                }
            } else {
                $this->errorMessage = $message;
            }
            $this->innerException = $innerException;
        }
    }