2011-04-05 88 views
1

我试图让我的日志编写器工作,但是,我没有那么远。ZF不会发生异常

当我抛出一个异常:

<?php 

class IndexController extends Zend_Controller_Action 
{ 
    public function indexAction() 
    { 
     throw new Exception('something bad happened!'); 
    } 
} 

它没有被我抓到errorcontroller。

检查我的版本是1.11.4 env开发。我不确定这里有什么问题,任何帮助表示赞赏。我觉得很奇怪。

(!) Exception: something bad happened! in C:\sites\mysite\application\controllers\IndexController.php on line 7 
Call Stack 
# Time Memory Function Location 
1 0.0004 350304 {main}() ..\index.php:0 
2 0.0705 5273208 Zend_Application->run() ..\index.php:31 
3 0.0705 5273208 Zend_Application_Bootstrap_Bootstrap->run() ..\Application.php:366 
4 0.0705 5273384 Zend_Controller_Front->dispatch() ..\Bootstrap.php:97 

回答

2

我认为你必须throwExceptions设置为1在你的application.ini您的开发环境;)

+0

你的意思是'resources.frontController.params.displayExceptions'? – Phil 2011-04-05 22:34:47

+1

不,他的意思是'resources.frontController.throwExceptions' – 2011-04-06 13:29:44

+0

fireeyedboy是对的:) – 2011-04-06 14:23:29