https://bugzilla.wikimedia.org/show_bug.cgi?id=63481

            Bug ID: 63481
           Summary: Improve error handing for hook functions.
           Product: MediaWiki
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: General/Unknown
          Assignee: wikibugs-l@lists.wikimedia.org
          Reporter: daniel.kinz...@wikimedia.de
       Web browser: ---
   Mobile Platform: ---

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to