Add a maintenance script to remove all users from a User Group
[lhc/web/wiklou.git] / api.php
diff --git a/api.php b/api.php
index 9c5ac95..9cf7578 100644 (file)
--- a/api.php
+++ b/api.php
@@ -72,7 +72,11 @@ try {
        if ( !$processor instanceof ApiMain ) {
                throw new MWException( 'ApiBeforeMain hook set $processor to a non-ApiMain class' );
        }
-} catch ( Exception $e ) {
+} catch ( Exception $e ) { // @todo Remove this block when HHVM is no longer supported
+       // Crap. Try to report the exception in API format to be friendly to clients.
+       ApiMain::handleApiBeforeMainException( $e );
+       $processor = false;
+} catch ( Throwable $e ) {
        // Crap. Try to report the exception in API format to be friendly to clients.
        ApiMain::handleApiBeforeMainException( $e );
        $processor = false;
@@ -99,7 +103,9 @@ if ( $wgAPIRequestLog ) {
                try {
                        $manager = $processor->getModuleManager();
                        $module = $manager->getModule( $wgRequest->getVal( 'action' ), 'action' );
-               } catch ( Exception $ex ) {
+               } catch ( Exception $ex ) { // @todo Remove this block when HHVM is no longer supported
+                       $module = null;
+               } catch ( Throwable $ex ) {
                        $module = null;
                }
                if ( !$module || $module->mustBePosted() ) {