Zend framework Zend框架错误处理

Zend framework Zend框架错误处理,zend-framework,Zend Framework,我想使用默认的ErrorCongtroller来处理错误。我把它注册为前端控制器插件,但它什么也不做。我应该设置其他内容来捕获不存在的控制器和操作,还是应该向其他控制器添加一些代码? 以下是注册的代码片段: $front = Zend_Controller_Front::getInstance(); $front->registerPlugin(new Zend_Controller_Plugin_ErrorHandler()); $front->returnResponse(tru

我想使用默认的ErrorCongtroller来处理错误。我把它注册为前端控制器插件,但它什么也不做。我应该设置其他内容来捕获不存在的控制器和操作,还是应该向其他控制器添加一些代码? 以下是注册的代码片段:

$front = Zend_Controller_Front::getInstance();
$front->registerPlugin(new Zend_Controller_Plugin_ErrorHandler());
$front->returnResponse(true);
$front->throwExceptions(true);

设置
$front->throweexceptions(false)时会发生什么情况

我相信只有当你告诉前端控制器不要抛出异常时,ErrorHandler才会捕捉到异常(或者,我想这就是我的意思)

另外,您是否对返回的响应进行了处理?因为您已经设置了
$front->returnResponse(true),您需要自己收集响应并使用以下内容输出:

$response = $front->dispatch();
$response->sendResponse();

设置
$front->throweexceptions(false)时会发生什么情况

我相信只有当你告诉前端控制器不要抛出异常时,ErrorHandler才会捕捉到异常(或者,我想这就是我的意思)

另外,您是否对返回的响应进行了处理?因为您已经设置了
$front->returnResponse(true),您需要自己收集响应并使用以下内容输出:

$response = $front->dispatch();
$response->sendResponse();

您使用的是什么版本的ZF?据我所知,在最新版本中,错误处理程序是默认注册的。它唯一需要的“东西”是默认模块中的
ErrorController
,带有
errorAction


有关详细信息,请参阅手册:

您使用的是什么版本的ZF?据我所知,在最新版本中,错误处理程序是默认注册的。它唯一需要的“东西”是默认模块中的
ErrorController
,带有
errorAction


有关详细信息,请参阅手册:

I使用1.9.5。我读到错误控制应该在默认情况下注册,但它不起作用。我使用Quickstart项目()中的错误控制器,我使用1.9.5。我读到错误控制应该在默认情况下注册,但它不起作用。我使用了Quickstart项目()中的错误控制器,我已经尝试了ThroweException true/false。没有区别。我已经试过使用ThroweException true/false。没有区别。