Last modified: 2014-04-29 14:09:36 UTC
There should be a "fail safe" variant of wfRunHooks (resp Hooks::run) which would catch, log and ignore any exception thrown by a hook function. THis could be implemented using an optional parameter to Hooks::run which takes an ExceptionHandler object. ExceptionHandler::handleException( Exception $ex ) would return a bool that determins whether the hook should be continued (just like regular hook functions do). The implementation used per default would just rethrow the exception. An alternative implementation could log the error using wfLogWarning, and then continue (by returning true) or abort (by returning false). This is more convenient, and allows better control, than just wrapping wfRunHooks in try/catch everywhere.