Merge "API: Overhaul ApiResult, make format=xml not throw, and add json formatversion"
[lhc/web/wiklou.git] / includes / api / ApiMain.php
index 5f6bd95..465025c 100644 (file)
@@ -89,6 +89,7 @@ class ApiMain extends ApiBase {
                'imagerotate' => 'ApiImageRotate',
                'revisiondelete' => 'ApiRevisionDelete',
                'managetags' => 'ApiManageTags',
+               'tag' => 'ApiTag',
        );
 
        /**
@@ -457,7 +458,13 @@ class ApiMain extends ApiBase {
                // Bug 63145: Rollback any open database transactions
                if ( !( $e instanceof UsageException ) ) {
                        // UsageExceptions are intentional, so don't rollback if that's the case
-                       MWExceptionHandler::rollbackMasterChangesAndLog( $e );
+                       try {
+                               MWExceptionHandler::rollbackMasterChangesAndLog( $e );
+                       } catch ( DBError $e2 ) {
+                               // Rollback threw an exception too. Log it, but don't interrupt
+                               // our regularly scheduled exception handling.
+                               MWExceptionHandler::logException( $e2 );
+                       }
                }
 
                // Allow extra cleanup and logging