{"record":{"id":"f47b8395edb64446","repo":"filp/whoops","slug":"handler-must-be-a-callable-or-instance-of-whoops","errorCode":null,"errorMessage":"Handler must be a callable, or instance of Whoops\\Handler\\HandlerInterface","messagePattern":"Handler must be a callable, or instance of Whoops\\\\Handler\\\\HandlerInterface","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"src/Whoops/Run.php","lineNumber":579,"sourceCode":"    }\n\n    /**\n     * Resolves the giving handler.\n     *\n     * @param callable|HandlerInterface $handler\n     *\n     * @return HandlerInterface\n     *\n     * @throws InvalidArgumentException\n     */\n    private function resolveHandler($handler)\n    {\n        if (is_callable($handler)) {\n            $handler = new CallbackHandler($handler);\n        }\n\n        if (!$handler instanceof HandlerInterface) {\n            throw new InvalidArgumentException(\n                \"Handler must be a callable, or instance of \"\n                . \"Whoops\\\\Handler\\\\HandlerInterface\"\n            );\n        }\n\n        return $handler;\n    }\n\n    /**\n     * Echo something to the browser.\n     *\n     * @param string $output\n     *\n     * @return Run\n     */\n    private function writeToOutputNow($output)\n    {\n        if ($this->sendHttpCode() && Misc::canSendHeaders()) {","sourceCodeStart":561,"sourceCodeEnd":597,"githubUrl":"https://github.com/filp/whoops/blob/fa1bc9c95a1b392fbdb8a410dbbcb1d6a030fff7/src/Whoops/Run.php#L561-L597","documentation":"Error \"Handler must be a callable, or instance of Whoops\\Handler\\HandlerInterface\" thrown in filp/whoops.","triggerScenarios":"Thrown at src/Whoops/Run.php:579 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"}