Reputation: 31307
At the present, when I type a wrong address I get the following:
exception 'Zend_Acl_Exception' with message 'Resource 'default_asda' not found' in /home/alkimi/www/ ...
I would like to, instead of this, display a costumized 404.
How can we configure the framework for doing so?
Thanks a lot, MEM
Upvotes: 0
Views: 619
Reputation: 892
You can check if action and controller exists (is dispatchable) before checking permissions:
$front = Zend_Controller_Front::getInstance();
if (!$front->getDispatcher()->isDispatchable($request)) {
throw new Zend_Exception('Page not found', 404);
return false;
}
Upvotes: 0
Reputation: 164730
You get that exception when you attempt to query your ACL for a non-existant resource. You should check your ACL for the resource before calling isAllowed
, eg
if (!$acl->has($resource)) {
// do something that triggers or leads to a 404
}
Upvotes: 2