{"record":{"id":"e280fbc9702ad320","repo":"filp/whoops","slug":"use-handleunconditionally-instead-of-whoops-test-e","errorCode":null,"errorMessage":"Use handleUnconditionally instead of whoops-test environment variable","messagePattern":"Use handleUnconditionally instead of whoops-test environment variable","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/Whoops/Handler/PrettyPageHandler.php","lineNumber":194,"sourceCode":"            $this->templateHelper->setCloner($cloner);\n        }\n    }\n\n    /**\n     * @return int|null\n     *\n     * @throws \\Exception\n     */\n    public function handle()\n    {\n        if (!$this->handleUnconditionally()) {\n            // Check conditions for outputting HTML:\n            // @todo: Make this more robust\n            if (PHP_SAPI === 'cli') {\n                // Help users who have been relying on an internal test value\n                // fix their code to the proper method\n                if (isset($_ENV['whoops-test'])) {\n                    throw new \\Exception(\n                        'Use handleUnconditionally instead of whoops-test'\n                        .' environment variable'\n                    );\n                }\n\n                return Handler::DONE;\n            }\n        }\n\n        $templateFile = $this->getResource(\"views/layout.html.php\");\n        $cssFile      = $this->getResource(\"css/whoops.base.css\");\n        $zeptoFile    = $this->getResource(\"js/zepto.min.js\");\n        $prismJs = $this->getResource(\"js/prism.js\");\n        $prismCss = $this->getResource(\"css/prism.css\");\n        $clipboard    = $this->getResource(\"js/clipboard.min.js\");\n        $jsFile       = $this->getResource(\"js/whoops.base.js\");\n\n        if ($this->customCss) {","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/filp/whoops/blob/fa1bc9c95a1b392fbdb8a410dbbcb1d6a030fff7/src/Whoops/Handler/PrettyPageHandler.php#L176-L212","documentation":"Error \"Use handleUnconditionally instead of whoops-test environment variable\" thrown in filp/whoops.","triggerScenarios":"Thrown at src/Whoops/Handler/PrettyPageHandler.php:194 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa1bc9c95a1b392fbdb8a410dbbcb1d6a030fff7","analyzedAt":"2026-08-21T01:30:26.400Z","schemaVersion":2},"datasetVersion":"2026-08-21T03:17:12.404Z"}