Throw a 404 error

@access public
@param string $message An additional message to add to the error
346392
public static function code_404($message = null, $exit = true) {
		if ($message !== null) {
			$message = ' (' . $message . ')';
		}

		header('HTTP/1.1 404 Not Found' . $message, true);
		echo '404 Not Found' . $message;

		if ($exit) {
			exit();
		}
	}
12494
public function addError($message, ...$text): void
    {
        $this->add(self::TYPE_ERROR, $message, ...$text);
    }
1189578
public function error($message) {
        $message = printPretty($message, $return=true);

        $hStream = CLI ? \STDERR : fopen('php://stderr', 'a');
        fwrite($hStream, $message);
        if (!CLI) fclose($hStream);
    }
357968
public function exceptionHandler($message)
    {
        $errorCode = $message->getCode()?: 404;

        if($this->customErrorViewExist($errorCode)) {
            $this->response->send(
                view("errors.{$errorCode}")
            );
        }

        error_log("planet.ERROR ".$message->getMessage() . "\nStack trace:\n" . $message->getTraceAsString());

        if(php_sapi_name() == 'cli') {
            (new ConsoleApplication)->renderException($message, new ConsoleOutput);
        } else {
            $debugMode = filter_var($this->app->config->getApp('debug'), FILTER_VALIDATE_BOOLEAN);

            $exceptionHandler = new ExceptionHandler($debugMode);

            $exceptionHandler->sendPhpResponse($message);
        }
    }
892525
public function handleInternal(string $path, string $message = null)
    {
        $route = $this->internalRoutes[$path]
            ?? $this->internalRoutes[null]
            ?? null;

        if (!$route) {
            throw new NotFoundException("No internal route to handle: " . $path);
        }

        $this->errorMessage = $message;
        if ($message) {
            $route->setArguments([$message]);
        }

        $route->setMatchedPath($path);
        $this->lastRoute = $route;
        return $route->handle(null, $this->di);
    }
266918
public function addErrorMessage($message, $params = array())
    {
        $message = $this->trans($message, $params);
        static::$messages[] = array(
            'type' => 'error',
            'bootstrapType' => 'danger',
            'message' => $message
        );
        static::$success = false;
    }
852757
protected function _handleLdapError($message)
    {
        $extendedError = $this->_ldap->getDiagnosticMessage();
        if (!is_null($extendedError)) {
            $this->_errors[] = $extendedError;
        }
        $this->_errors[] = $message;
    }
65458
protected function debug($message)
    {
        if ($this->debug) {
            if ($this->debug_handler) {
                call_user_func_array(
                    $this->debug_handler, array(&$this, $message)
                );
            } else {
                echo "DEBUG: $message\n";
            }
        }
    }
1271000
public function theResponseIsGraphQLErrorWith(string $message)
    {
        $this->assertResponseStatus(Response::HTTP_OK);

        //success GraphQL response should not contains errors
        if ($this->client->getGraphQL()) {
            if ($this->isValidGraphQLResponse() && $errors = $this->getGraphQLResponseError()) {
                $errorsStack = '';
                foreach ($errors as $error) {
                    $errorsStack .= $error->message."\n";
                }

                Assert::assertContains($message, $errorsStack);
            } else {
                $this->graphQLContext->debugLastQuery();
                throw new AssertionFailedError('The response is not the expected error response.');
            }
        }
    }
151802
private function throwValidationFailed($message, array $errors, $data = [], $status = 422, array $headers = [])
    {
        throw new HttpResponseException(
            $this->validationFailedResponse($message, $errors, $data, $status, $headers));
    }
194653
public function setError(?string $message = null) : void
    {
        $this->is_valid = false;
        $this->error = (null === $message) ? $this->default_error : $message;
    }
583918
public static function exitWithErrorMessage($message)
    {
        Common::sendHeader('Content-Type: text/html; charset=utf-8');

        $message = str_replace("\n", "<br/>", $message);

        $output = "<html><body>".
            "<style>a{color:red;}</style>\n" .
            "<div style='color:red;font-size:120%; width:100%;margin: 30px;'>" .
            " <div style='width: 50px; float: left;'><img src='plugins/Morpheus/images/error_medium.png' /></div>" .
            "  <div style='margin-left: 70px; min-width: 950px;'>" .
            $message .
            "  </div>" .
            " </div>" .
            "</div>".
            "</body></html>";
        print($output);
        exit;
    }
760532
public function err( $message )
	{
		$ex = new Exception();
		echo $ex->getTraceAsString();

		if ( ! $this->log ) return;
		return $this->log->err( $message );
	}
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 );
        }
    }
1287795
protected function fail($message, $http_status = 500)
    {
        if (!empty($this->options['fail_exception'])) {
            throw new Exception($message, $http_status);
        }

        if ($http_status === 500) {
            trigger_error($message, E_USER_WARNING);
        }

        if ($this->returnType === 'jsonp') {
            echo $_REQUEST['callback'] . "(" . json_encode(['error' => $message]) . ", $http_status);";
            exit();
        }

        if ($this->returnType === 'redirect') {
            $url = $_REQUEST['return_url'] . '?sso_error=' . $message;
            header("Location: $url", true, 307);
            echo "You're being redirected to <a href='{$url}'>$url</a>";
            exit();
        }

        http_response_code($http_status);
        header('Content-type: application/json; charset=UTF-8');

        echo json_encode(['error' => $message]);
        exit();
    }
1355714
function error($message) {
		$this->CleanUp();
		if (!isset($this->info['error'])) {
			$this->info['error'] = array();
		}
		$this->info['error'][] = $message;
		return $this->info;
	}
1165904
public function setError($status, string $message = null)
    {
        $this->setDot('json.error', $status);

        if (!is_null($message)) {
            $this->setDot('json.message', $message);
        }

        return $this;
    }