在Zend Framework中,对异常的使用,整理思路体现其官方Reference Guide的此段描述中:
The MVC components in Zend Framework utilize a Front Controller, which means that all requests to a given site will go through a single entry point. As a result, all exceptions bubble up to the Front Controller eventually, allowing the developer to handle them in a single location.
However, exception messages and backtrace information often contain sensitive system information, such as SQL statements, file locations, and more. To help protect your site, by default Zend_Controller_Front catches all exceptions and registers them with the response object; in turn, by default, the response object does not display exception messages.
了解Zend Framework中对异常的使用,首先参考官方的资料进行了解:
http://framework.zend.com/manual/1.12/en/zend.controller.exceptions.html
另外,下面的几个web,是在Google中找到的几个实际使用的示例: