filp/whoops · error · InvalidArgumentException

Handler must be a callable, or instance of Whoops\Handler\Ha

Error message

Handler must be a callable, or instance of Whoops\Handler\HandlerInterface

What it means

Error "Handler must be a callable, or instance of Whoops\Handler\HandlerInterface" thrown in filp/whoops.

Source

Thrown at src/Whoops/Run.php:579

    }

    /**
     * Resolves the giving handler.
     *
     * @param callable|HandlerInterface $handler
     *
     * @return HandlerInterface
     *
     * @throws InvalidArgumentException
     */
    private function resolveHandler($handler)
    {
        if (is_callable($handler)) {
            $handler = new CallbackHandler($handler);
        }

        if (!$handler instanceof HandlerInterface) {
            throw new InvalidArgumentException(
                "Handler must be a callable, or instance of "
                . "Whoops\\Handler\\HandlerInterface"
            );
        }

        return $handler;
    }

    /**
     * Echo something to the browser.
     *
     * @param string $output
     *
     * @return Run
     */
    private function writeToOutputNow($output)
    {
        if ($this->sendHttpCode() && Misc::canSendHeaders()) {

View on GitHub (pinned to fa1bc9c95a)

When it happens

Trigger: Thrown at src/Whoops/Run.php:579 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/f47b8395edb64446. Report an issue: GitHub.