diff --git a/reference/yaf/yaf_dispatcher/catchexception.xml b/reference/yaf/yaf_dispatcher/catchexception.xml index 707dde41da..4d5b842b1c 100644 --- a/reference/yaf/yaf_dispatcher/catchexception.xml +++ b/reference/yaf/yaf_dispatcher/catchexception.xml @@ -20,12 +20,9 @@ then if you enable Yaf_Dispatcher::catchException(also can enabled by set - application.dispatcher.catchException), all Un-caught Exceptions will be - caught by ErrorController::error if you have defined one. + application.dispatcher.catchException), + all uncaught Exceptions will be caught by ErrorController::error if you have defined one. - - - @@ -35,7 +32,7 @@ flag - + bool @@ -95,6 +92,7 @@ class ErrorController extends Yaf_Controller_Abstract { &reftitle.seealso; Yaf_Dispatcher::throwException + Yaf_Dispatcher::setErrorHandler diff --git a/reference/yaf/yaf_dispatcher/seterrorhandler.xml b/reference/yaf/yaf_dispatcher/seterrorhandler.xml index c059214c58..babbb28183 100644 --- a/reference/yaf/yaf_dispatcher/seterrorhandler.xml +++ b/reference/yaf/yaf_dispatcher/seterrorhandler.xml @@ -4,7 +4,7 @@ Yaf_Dispatcher::setErrorHandler - The setErrorHandler purpose + Set error handler @@ -15,11 +15,13 @@ interror_types - + Set error handler for Yaf. when application.dispatcher.throwException + is off, Yaf will trigger catchable error while unexpected errors occrred. + + + Thus, this error handler will be called while the error raise. - - - @@ -29,7 +31,7 @@ callback - + A callable callback @@ -51,6 +53,14 @@ + + &reftitle.seealso; + + Yaf_Dispatcher::throwException + Yaf_Application::getLastErrorNo + Yaf_Application::getLastErrorMsg + + diff --git a/reference/yaf/yaf_dispatcher/throwexception.xml b/reference/yaf/yaf_dispatcher/throwexception.xml index 5932ecba6d..cc92a180d4 100644 --- a/reference/yaf/yaf_dispatcher/throwexception.xml +++ b/reference/yaf/yaf_dispatcher/throwexception.xml @@ -14,11 +14,15 @@ boolflag - + Siwtch on/off exception throwing while unexpected error occurring. + When this is on, Yaf will throwing exceptions instead of triggering + catchable errors. + + + You can also use + application.dispatcher.throwException to achieve the + same purpose. - - - @@ -28,7 +32,7 @@ flag - + bool @@ -42,6 +46,73 @@ + + &reftitle.examples; + + <function>Yaf_Dispatcher::throwexception</function>example + + array( + 'directory' => dirname(__FILE__), + ), +); +$app = new Yaf_Application($config); + +$app->getDispatcher()->throwException(true); + +try { + $app->run(); +} catch (Yaf_Exception $e) { + var_dump($e->getMessage()); +} +?> +]]> + + &example.outputs.similar; + + + + + + <function>Yaf_Dispatcher::throwexception</function>example + + array( + 'directory' => dirname(__FILE__), + ), +); +$app = new Yaf_Application($config); + +$app->getDispatcher()->throwException(false); + +$app->run(); +?> +]]> + + &example.outputs.similar; + + + + + + + + &reftitle.seealso; + + Yaf_Dispatcher::catchException + Yaf_Exception + +