Show error page and terminate script execution

@param int    $code    Error code
@param string $message Error message
189894
public function raise_error($code, $message)
    {
        if ($code == 403) {
            header('HTTP/1.1 403 Forbidden');
            die("Invalid Request");
        }

        $this->show_message("Application Error ($code): $message", 'error');
        $this->remote_response();
        exit;
    }
1106799
public static function setError($code, $message = '')
    {
        if (!isset(self::$errorCodes[$code])) {
            throw new \InvalidArgumentException(sprintf('No such error code: "%s"', $code));
        }

        self::$errorMessage = $message ? sprintf('%s: %s', $message, self::$errorCodes[$code]) : self::$errorCodes[$code];
        self::$errorCode = $code;
    }
909602
public function error($error, $code = 0)
    {
        $this->_errors[] = $error instanceof Error ? $error : new Error($code, $error);
    }
1057988
protected function output($message, $data = [], $code = 0)
    {
        JsonOutput::output($message, $data, $code);
        $this->getApp()->end();
    }
1355105
public function sendError($code, $message = null)
    {
        if ($this->ajaxOnly === false) {
            output()->setContentType('application/json');
        }

        if (is_array($code)) {
            if (is_numeric(key($code))) {
                $message = reset($code);
                $code = key($code);
            } elseif (isset($code[ 'code' ])) {
                $code = $code[ 'code' ];
                $message = $code[ 'message' ];
            }
        }

        output()->sendError($code, $message);
    }
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);

    }
1364041
private function error(string $message, $status = 1)
    {
        $this->printer->printError($message);
        exit($status);
    }
671453
private function interrupt( $message, $errorCode = false, $filename = false )
    {
        header( 'Content-Type: text/html' );
        switch ( $errorCode )
        {
            case 404:
                $filename = htmlspecialchars( $filename );
                header( $_SERVER['SERVER_PROTOCOL'] . " 404 Not Found" );
                echo <<<EOF
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<H1>Not Found</H1>
<p>The requested URL {$filename} was not found on this server.<p>
</body></html>
EOF;
            exit( 1 );

            case 416:
                header( $_SERVER['SERVER_PROTOCOL'] . " 416 Requested Range Not Satisfiable" );
                echo <<<EOF
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>416 Requested Range Not Satisfiable</title>
</head><body>
<h1>416 Requested Range Not Satisfiable</h1>
</body></html>
EOF;
            exit( 1 );

            case 500:
            default:
                if ( !CLUSTER_ENABLE_DEBUG )
                    $message = "An error has occured";
                header( $_SERVER['SERVER_PROTOCOL'] . " 500 Internal Server Error" );
                echo <<<EOF
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>$message</h1>
</body></html>
EOF;
                trigger_error( $message, E_USER_ERROR );
        }
    }
358781
public function error($code, $msg, $file, $line)
    {
        $type = $this->getErrorType($code);

        $this->setParams($type, $code, $msg, $file, $line, '', 0);

        return $this->render();
    }
723934
public function errorHandler($code, $message, $file = '', $line = '')
    {
        if ($this->error_to_exception) {

            if (ob_get_length() > 0) {
                ob_end_clean(); // Fix templates
            }

            throw new Exception($message);
        }

        $error = array(
            'code' => $code,
            'file' => $file,
            'line' => $line,
            'message' => $message,
            'backtrace' => $this->log_backtrace ? gplcart_backtrace() : array()
        );

        $print = $this->print_error || !$this->isDb();

        if (in_array($code, $this->getFatalErrorTypes())) {

            if ($print) {
                return false; // Let it fall through to the standard PHP error handler
            }

            $this->log('php_shutdown', $error, 'danger', false);
            return true;
        }

        $key = md5(json_encode($error));

        if (isset($this->errors[$key])) {
            return true;
        }

        $this->errors[$key] = $error;

        if ($print) {
            echo $this->getFormattedError($error);
        }

        $this->log('php_error', $error, 'warning', false);
        return true;
    }
996176
public static function output($message, $data = [], $code = 0)
    {
        header('Content-Type:text/html;Charset=' . APP_CHARSET);
        $output = [
            'code' => $code,
            'message' => $message,
            'data' => $data,
        ];
        if (isset($_GET['e_callback']) && $_GET['e_callback']) {
            echo $_GET['e_callback'] . '(' . json_encode($output) . ')';
        } else {
            if (!headers_sent()) header('Content-type: application/json');
            echo json_encode($output);
        }
    }
591502
public function PEAR_Error($message = 'unknown error', $code = null,
                        $mode = null, $options = null, $userinfo = null) {
        self::__construct($message, $code, $mode, $options, $userinfo);
    }
695001
public void error(final int errorCode, final String message) {
		try {
			this.response.sendError(errorCode, message);
		} catch (final IOException e) {
			e.printStackTrace();
		}
	}
197381
protected function throwError(/*# string */ $message, /*# int */ $code)
    {
        switch ($this->error_type) {
            case self::ERROR_WARNING:
                trigger_error($message, \E_USER_WARNING);
                break;
            case self::ERROR_EXCEPTION:
                throw new LogicException($message, $code);
            default:
                break;
        }
        return $this;
    }
515516
protected function _throwValidationException(
        $message = null,
        $code = null,
        RootException $previous = null,
        $validator = null
    ) {
        if ($validator === true) {
            $validator = $this;
        }

        throw $this->_createValidationException($message, $code, $previous, $validator);
    }
932127
protected function _error($message, $code, $exception = null, $context = [])
    {
        if (isset($this->_errorHandler)) {
            call_user_func($this->_errorHandler, $message, $code, $exception, $context);
            trigger_error('FQDB error handler function should die() or throw another exception!', E_ERROR);
        } else {
            throw new FQDBException($message, $code, $exception);
        }
    }
245875
public function handle($code, $error, $file = null, $line = null) : void
    {
        $this->honeybadger->notify(
            new ErrorException($error, $code, 0, $file, $line)
        );

        call_user_func($this->previousHandler, $code, $error, $file, $line);
    }