Yaf_Dispatcher::setErrorHandler
(Yaf >=1.0.0)
Yaf_Dispatcher::setErrorHandler — 设置错误处理函数
说明
设置错误处理函数,一般在application.dispatcher.throwException关闭的情况下,Yaf会在出错的时候触发错误,这个时候,如果设置了错误处理函数,则会把控制交给错误处理函数处理。
因此,当错误发生的时候这个错误处理函数将被调用。
参数
-
callback
-
错误处理的回调函数
-
error_types
-
返回值
参见
- Yaf_Dispatcher::throwException() - 开启/关闭异常抛出
- Yaf_Application::getLastErrorNo() - 获取最后产生的错误的错误代码
- Yaf_Application::getLastErrorMsg() - 获取最近产生的错误的错误信息

User Contributed Notes 1 note
gianjason#gmail.com ¶
9 years ago
eg:
<?php $dispatcher->setErrorHandler(array(get_class($this),'error_handler')); ?>
备份地址:http://www.lvesu.com/blog/php/yaf-dispatcher.seterrorhandler.php