phalcon/cphalcon · error · Phalcon\Mvc\Dispatcher\Exceptions\ResponseServiceUnavailable

EXCEPTION_NO_DI

EXCEPTION_NO_DI

Error message

A dependency injection container is required to access the 'response' service

What it means

Error "A dependency injection container is required to access the 'response' service" thrown in phalcon/cphalcon.

Source

Thrown at phalcon/Mvc/Dispatcher.zep:222

        if typeof eventsManager == "object" {
            if eventsManager->fire("dispatch:beforeException", this, exception) === false {
                return false;
            }
        }
    }

    /**
     * Throws an internal exception
     */
    protected function throwDispatchException( string message, int exceptionCode = 0)
    {
        var container, response, exception;

        let container = this->container;

        if container === null {
            throw new ResponseServiceUnavailable();
        }

        let response = <ResponseInterface> container->getShared("response");

        /**
         * Dispatcher exceptions automatically sends a 404 status
         */
        response->setStatusCode(404, "Not Found");

        /**
         * Create the real exception
         */
        let exception = new Exception(message, exceptionCode);

        if this->handleException(exception) === false {
            return false;
        }

View on GitHub (pinned to b7419de9cd)

When it happens

Trigger: Thrown at phalcon/Mvc/Dispatcher.zep:222 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of phalcon/cphalcon@b7419de9cd (2026-08-21). Data as JSON: /api/errors/789c276888166bc6. Report an issue: GitHub.