phalcon/cphalcon · error · Phalcon\Mvc\Micro\Exceptions\HandlerNotCallable

'after' handler is not callable

Error message

'after' handler is not callable

What it means

Error "'after' handler is not callable" thrown in phalcon/cphalcon.

Source

Thrown at phalcon/Mvc/Micro.zep:580

                    this->eventsManager->fire("micro:afterExecuteRoute", this);
                }

                let afterHandlers = this->afterHandlers;

                let this->stopped = false;

                /**
                 * Calls the after handlers
                 */
                for after in afterHandlers {
                    if typeof after === "object" && after instanceof MiddlewareInterface {
                        /**
                         * Call the middleware
                         */
                        let status = after->call(this);
                    } else {
                        if unlikely !is_callable(after) {
                            throw new HandlerNotCallable("after");
                        }

                        let status = call_user_func(after);
                    }

                    /**
                     * break the execution if the middleware was stopped
                     */
                    if this->stopped {
                        break;
                    }
                }
            } else {
                 /**
                  * Calling beforeNotFound event
                  */
                if this->eventsManager !== null {
                    if this->eventsManager->fire("micro:beforeNotFound", this) === false {

View on GitHub (pinned to b7419de9cd)

When it happens

Trigger: Thrown at phalcon/Mvc/Micro.zep:580 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/047b9f55325aa1b9. Report an issue: GitHub.