filp/whoops · error · Exception

Use handleUnconditionally instead of whoops-test environment

Error message

Use handleUnconditionally instead of whoops-test environment variable

What it means

Error "Use handleUnconditionally instead of whoops-test environment variable" thrown in filp/whoops.

Source

Thrown at src/Whoops/Handler/PrettyPageHandler.php:194

            $this->templateHelper->setCloner($cloner);
        }
    }

    /**
     * @return int|null
     *
     * @throws \Exception
     */
    public function handle()
    {
        if (!$this->handleUnconditionally()) {
            // Check conditions for outputting HTML:
            // @todo: Make this more robust
            if (PHP_SAPI === 'cli') {
                // Help users who have been relying on an internal test value
                // fix their code to the proper method
                if (isset($_ENV['whoops-test'])) {
                    throw new \Exception(
                        'Use handleUnconditionally instead of whoops-test'
                        .' environment variable'
                    );
                }

                return Handler::DONE;
            }
        }

        $templateFile = $this->getResource("views/layout.html.php");
        $cssFile      = $this->getResource("css/whoops.base.css");
        $zeptoFile    = $this->getResource("js/zepto.min.js");
        $prismJs = $this->getResource("js/prism.js");
        $prismCss = $this->getResource("css/prism.css");
        $clipboard    = $this->getResource("js/clipboard.min.js");
        $jsFile       = $this->getResource("js/whoops.base.js");

        if ($this->customCss) {

View on GitHub (pinned to fa1bc9c95a)

When it happens

Trigger: Thrown at src/Whoops/Handler/PrettyPageHandler.php:194 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of filp/whoops@fa1bc9c95a (2026-08-21). Data as JSON: /api/errors/e280fbc9702ad320. Report an issue: GitHub.