Merge "New hook ApiCheckCanExecute."
[lhc/web/wiklou.git] / includes / api / ApiMain.php
index 3dadb42..35febd9 100644 (file)
@@ -368,6 +368,9 @@ class ApiMain extends ApiBase {
                try {
                        $this->executeAction();
                } catch ( Exception $e ) {
+                       // Allow extra cleanup and logging
+                       wfRunHooks( 'ApiMain::onException', array( $this, $e ) );
+
                        // Log it
                        if ( !( $e instanceof UsageException ) ) {
                                wfDebugLog( 'exception', $e->getLogMessage() );