getgrav/grav · error · RuntimeException

$e->getRawMessage()

Error message

$e->getRawMessage()

What it means

Error "$e->getRawMessage()" thrown in getgrav/grav.

Source

Thrown at system/src/Grav/Common/Twig/Twig.php:459

            // Editor-authored content Twig can assemble markup the raw-source
            // validator can't see (`{{ "on" ~ "error" }}`, `<s{{ "cript" }}>`).
            // That is caught at SAVE time now — Security::detectXssInEditorContent
            // renders this same sandboxed pass in isolation and rejects the save —
            // so there is no render-time output scan here. (GHSA-2c4f-86xc-cr74)

            // Modular theme template render (loaded from disk) — trusted, not
            // sandboxed by our SourcePolicy. The already-resolved content is
            // handed in as the `content` variable; Twig emits it as a string
            // and does not re-evaluate it.
            if ($moduleTemplate && $item->isModule()) {
                $twig_vars['content'] = $content;
                $template = $this->getPageTwigTemplate($item);
                $output = $local_twig->render($template, $twig_vars);
            }

        } catch (LoaderError $e) {
            throw new RuntimeException($e->getRawMessage(), 400, $e);
        }

        if ($filtered) {
            $output = $this->appendSandboxAdminHint($output);
        }

        return $output;
    }

    /**
     * Process a Twig template directly by using a template name
     * and optional array of variables
     *
     * @param string $template template to render with
     * @param array  $vars     Optional variables
     *
     * @return string
     */

View on GitHub (pinned to 6040efed04)

When it happens

Trigger: Thrown at system/src/Grav/Common/Twig/Twig.php:459 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of getgrav/grav@6040efed04 (2026-08-17). Data as JSON: /api/errors/8ae631dff5fbd64a. Report an issue: GitHub.