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

'before' handler is not callable

Error message

'before' handler is not callable

What it means

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

Source

Thrown at phalcon/Mvc/Micro.zep:427

                    let handler = this->activeHandler;
                }

                let beforeHandlers = this->beforeHandlers;
                let this->stopped = false;

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

                        /**
                         * Call the before handler
                         */
                        let status = call_user_func(before);
                    }

                    /**
                     * Return the status if the middleware was stopped
                     */
                    if this->stopped {
                        return status;
                    }
                }

                let params = router->getParams();

View on GitHub (pinned to b7419de9cd)

When it happens

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