phalcon/cphalcon · error · Phalcon\Mvc\Micro\Exceptions\HandlerNotCallable
' ' handler is not callable
Error message
'{type}' handler is not callable What it means
Thrown by Micro::handle while running 'finish' handlers when an entry is not callable and not MiddlewareInterface. Finish handlers must be callables or middleware objects; fix the registered finish handler.
Solutions
- Register only callables or MiddlewareInterface implementations with finish()
- Remove malformed entries from the finish list
Defensive patterns
Strategy: type-guard
When it happens
Trigger: Thrown at phalcon/Mvc/Micro.zep:642 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/28b90cf2b357a442.
Report an issue: GitHub.
Appendix: source
Thrown at phalcon/Mvc/Micro.zep:642
let finishHandlers = this->finishHandlers;
let this->stopped = false;
/**
* Calls the finish handlers
*/
for finish in finishHandlers {
/**
* Try to execute middleware as plugins
*/
if typeof finish === "object" && finish instanceof MiddlewareInterface {
/**
* Call the middleware
*/
let status = finish->call(this);
} else {
if unlikely !is_callable(finish) {
throw new HandlerNotCallable("finish");
}
/**
* Call the 'finish' middleware
*/
let status = call_user_func_array(
finish,
[this]
);
}
/**
* break the execution if the middleware was stopped
*/
if this->stopped {
break;
}
}View on GitHub (pinned to b7419de9cd)