Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/184004

Change subject: Updated some try-catch statements: MWException -> Exception
......................................................................

Updated some try-catch statements: MWException -> Exception

Change-Id: I76601a86e30f4984e3b1a8c8ec5ef5a0f652433a
---
M includes/CategoryViewer.php
M includes/FileDeleteForm.php
M includes/GlobalFunctions.php
M includes/api/ApiImport.php
M includes/api/ApiQueryRecentChanges.php
M includes/api/ApiQueryWatchlist.php
M includes/api/ApiUpload.php
M includes/cache/bloom/BloomCache.php
M includes/db/Database.php
M includes/db/DatabaseError.php
M includes/deferred/DeferredUpdates.php
M includes/exception/MWExceptionHandler.php
M includes/externalstore/ExternalStore.php
M includes/filebackend/SwiftFileBackend.php
M includes/filebackend/lockmanager/DBLockManager.php
M includes/htmlform/HTMLFormField.php
M includes/installer/DatabaseInstaller.php
M includes/installer/Installer.php
M includes/jobqueue/JobQueue.php
M includes/jobqueue/JobRunner.php
M includes/jobqueue/jobs/AssembleUploadChunksJob.php
M includes/jobqueue/jobs/PublishStashedFileJob.php
M includes/media/BMP.php
M includes/media/BitmapMetadataHandler.php
M includes/media/Jpeg.php
M includes/media/SVG.php
M includes/media/Tiff.php
M includes/media/XCF.php
M includes/media/XMP.php
M includes/page/Article.php
M includes/page/WikiPage.php
M includes/parser/Parser.php
M includes/specials/SpecialContributions.php
M includes/specials/SpecialImport.php
M includes/specials/SpecialNewimages.php
M includes/specials/SpecialRandomInCategory.php
M includes/specials/SpecialUpload.php
M includes/utils/UIDGenerator.php
M maintenance/doMaintenance.php
M maintenance/language/checkLanguage.php
M maintenance/populateRevisionSha1.php
M maintenance/preprocessorFuzzTest.php
42 files changed, 51 insertions(+), 50 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/04/184004/1

diff --git a/includes/CategoryViewer.php b/includes/CategoryViewer.php
index 4d23ed2..1a09d44 100644
--- a/includes/CategoryViewer.php
+++ b/includes/CategoryViewer.php
@@ -152,7 +152,7 @@
                        $mode = $this->getRequest()->getVal( 'gallerymode', 
null );
                        try {
                                $this->gallery = ImageGalleryBase::factory( 
$mode, $this->getContext() );
-                       } catch ( MWException $e ) {
+                       } catch ( Exception $e ) {
                                // User specified something invalid, fallback 
to default.
                                $this->gallery = ImageGalleryBase::factory( 
false, $this->getContext() );
                        }
diff --git a/includes/FileDeleteForm.php b/includes/FileDeleteForm.php
index 1c709e6..c1d14db 100644
--- a/includes/FileDeleteForm.php
+++ b/includes/FileDeleteForm.php
@@ -201,7 +201,7 @@
                                                $dbw->rollback( __METHOD__ );
                                        }
                                }
-                       } catch ( MWException $e ) {
+                       } catch ( Exception $e ) {
                                // Rollback before returning to prevent UI from 
displaying
                                // incorrect "View or restore N deleted edits?"
                                $dbw->rollback( __METHOD__ );
diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index f516759..a1c39fb 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -1328,7 +1328,7 @@
        // any knowledge about an URL and throw an exception instead.
        try {
                $ctx['url'] = urldecode( $wgRequest->getRequestURL() );
-       } catch ( MWException $ignored ) {
+       } catch ( Exception $ignored ) {
                // no-op
        }
 
diff --git a/includes/api/ApiImport.php b/includes/api/ApiImport.php
index a134074..c7dcce8 100644
--- a/includes/api/ApiImport.php
+++ b/includes/api/ApiImport.php
@@ -79,7 +79,7 @@
 
                try {
                        $importer->doImport();
-               } catch ( MWException $e ) {
+               } catch ( Exception $e ) {
                        $this->dieUsageMsg( array( 'import-unknownerror', 
$e->getMessage() ) );
                }
 
diff --git a/includes/api/ApiQueryRecentChanges.php 
b/includes/api/ApiQueryRecentChanges.php
index cdc61cd..def1e77 100644
--- a/includes/api/ApiQueryRecentChanges.php
+++ b/includes/api/ApiQueryRecentChanges.php
@@ -178,7 +178,7 @@
                if ( !is_null( $params['type'] ) ) {
                        try {
                                $this->addWhereFld( 'rc_type', 
RecentChange::parseToRCType( $params['type'] ) );
-                       } catch ( MWException $e ) {
+                       } catch ( Exception $e ) {
                                ApiBase::dieDebug( __METHOD__, $e->getMessage() 
);
                        }
                }
@@ -716,3 +716,4 @@
                return 'https://www.mediawiki.org/wiki/API:Recentchanges';
        }
 }
+https://gerrit.wikimedia.org/r/#/c/177001/3https://gerrit.wikimedia.org/r/#/c/177001/3https://gerrit.wikimedia.org/r/#/c/177001/3https://gerrit.wikimedia.org/r/#/c/177001/3
\ No newline at end of file
diff --git a/includes/api/ApiQueryWatchlist.php 
b/includes/api/ApiQueryWatchlist.php
index 4059ff8..6e60fe4 100644
--- a/includes/api/ApiQueryWatchlist.php
+++ b/includes/api/ApiQueryWatchlist.php
@@ -199,7 +199,7 @@
                if ( !is_null( $params['type'] ) ) {
                        try {
                                $this->addWhereFld( 'rc_type', 
RecentChange::parseToRCType( $params['type'] ) );
-                       } catch ( MWException $e ) {
+                       } catch ( Exception $e ) {
                                ApiBase::dieDebug( __METHOD__, $e->getMessage() 
);
                        }
                }
diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php
index 43e4c61..d6ad7f3 100644
--- a/includes/api/ApiUpload.php
+++ b/includes/api/ApiUpload.php
@@ -161,7 +161,7 @@
                        }
                } catch ( UploadStashException $e ) {
                        $this->handleStashException( $e );
-               } catch ( MWException $e ) {
+               } catch ( Exception $e ) {
                        $this->dieUsage( $e->getMessage(), 'stashfailed' );
                }
 
@@ -182,7 +182,7 @@
                try {
                        $result['filekey'] = $this->performStash();
                        $result['sessionkey'] = $result['filekey']; // 
backwards compatibility
-               } catch ( MWException $e ) {
+               } catch ( Exception $e ) {
                        $result['warnings']['stashfailed'] = $e->getMessage();
                }
 
@@ -209,7 +209,7 @@
                                $filekey = $this->performStash();
                        } catch ( UploadStashException $e ) {
                                $this->handleStashException( $e );
-                       } catch ( MWException $e ) {
+                       } catch ( Exception $e ) {
                                // FIXME: Error handling here is 
wrong/different from rest of this
                                $this->dieUsage( $e->getMessage(), 
'stashfailed' );
                        }
@@ -283,7 +283,7 @@
                                throw new MWException( 'Invalid stashed file' );
                        }
                        $fileKey = $stashFile->getFileKey();
-               } catch ( MWException $e ) {
+               } catch ( Exception $e ) {
                        $message = 'Stashing temporary file failed: ' . 
get_class( $e ) . ' ' . $e->getMessage();
                        wfDebug( __METHOD__ . ' ' . $message . "\n" );
                        $className = get_class( $e );
@@ -306,7 +306,7 @@
                try {
                        $data['filekey'] = $this->performStash();
                        $data['sessionkey'] = $data['filekey'];
-               } catch ( MWException $e ) {
+               } catch ( Exception $e ) {
                        $data['stashfailed'] = $e->getMessage();
                }
                $data['invalidparameter'] = $parameter;
diff --git a/includes/cache/bloom/BloomCache.php 
b/includes/cache/bloom/BloomCache.php
index 2720933..6ecaacb 100644
--- a/includes/cache/bloom/BloomCache.php
+++ b/includes/cache/bloom/BloomCache.php
@@ -114,7 +114,7 @@
                                if ( $useFilter ) {
                                        return ( $this->isHit( 'shared', 
"$virtualKey:$member" ) !== false );
                                }
-                       } catch ( MWException $e ) {
+                       } catch ( Exception $e ) {
                                MWExceptionHandler::logException( $e );
                                return true;
                        }
@@ -143,7 +143,7 @@
                                }
 
                                return $this->add( 'shared', $prefixedMembers );
-                       } catch ( MWException $e ) {
+                       } catch ( Exception $e ) {
                                MWExceptionHandler::logException( $e );
                                return false;
                        }
diff --git a/includes/db/Database.php b/includes/db/Database.php
index 0b022d1..054f27a 100644
--- a/includes/db/Database.php
+++ b/includes/db/Database.php
@@ -3962,7 +3962,7 @@
 
                try {
                        $error = $this->sourceStream( $fp, $lineCallback, 
$resultCallback, $fname, $inputCallback );
-               } catch ( MWException $e ) {
+               } catch ( Exception $e ) {
                        fclose( $fp );
                        throw $e;
                }
diff --git a/includes/db/DatabaseError.php b/includes/db/DatabaseError.php
index 2393bbb..86950a8 100644
--- a/includes/db/DatabaseError.php
+++ b/includes/db/DatabaseError.php
@@ -229,7 +229,7 @@
 
                                        return;
                                }
-                       } catch ( MWException $e ) {
+                       } catch ( Exception $e ) {
                                // Do nothing, just use the default page
                        }
                }
diff --git a/includes/deferred/DeferredUpdates.php 
b/includes/deferred/DeferredUpdates.php
index 93c53ad..42816dd 100644
--- a/includes/deferred/DeferredUpdates.php
+++ b/includes/deferred/DeferredUpdates.php
@@ -107,7 +107,7 @@
                                        if ( $doCommit && $dbw->trxLevel() ) {
                                                $dbw->commit( __METHOD__, 
'flush' );
                                        }
-                               } catch ( MWException $e ) {
+                               } catch ( Exception $e ) {
                                        // We don't want exceptions thrown 
during deferred updates to
                                        // be reported to the user since the 
output is already sent.
                                        // Instead we just log them.
diff --git a/includes/exception/MWExceptionHandler.php 
b/includes/exception/MWExceptionHandler.php
index ad462f2..5ea9359 100644
--- a/includes/exception/MWExceptionHandler.php
+++ b/includes/exception/MWExceptionHandler.php
@@ -142,7 +142,7 @@
         *
         *   try {
         *       ...
-        *   } catch ( MWException $e ) {
+        *   } catch ( Exception $e ) {
         *       $e->report();
         *   } catch ( Exception $e ) {
         *       echo $e->__toString();
diff --git a/includes/externalstore/ExternalStore.php 
b/includes/externalstore/ExternalStore.php
index 688130e..ea04cc8 100644
--- a/includes/externalstore/ExternalStore.php
+++ b/includes/externalstore/ExternalStore.php
@@ -197,7 +197,7 @@
                        }
                        try {
                                $url = $store->store( $path, $data ); // Try to 
save the object
-                       } catch ( MWException $error ) {
+                       } catch ( Exception $error ) {
                                $url = false;
                        }
                        if ( strlen( $url ) ) {
diff --git a/includes/filebackend/SwiftFileBackend.php 
b/includes/filebackend/SwiftFileBackend.php
index 4fde124..2637b5a 100644
--- a/includes/filebackend/SwiftFileBackend.php
+++ b/includes/filebackend/SwiftFileBackend.php
@@ -647,7 +647,7 @@
                        $timestamp = new MWTimestamp( $ts );
 
                        return $timestamp->getTimestamp( $format );
-               } catch ( MWException $e ) {
+               } catch ( Exception $e ) {
                        throw new FileBackendError( $e->getMessage() );
                }
        }
diff --git a/includes/filebackend/lockmanager/DBLockManager.php 
b/includes/filebackend/lockmanager/DBLockManager.php
index affcf44..39a5563 100644
--- a/includes/filebackend/lockmanager/DBLockManager.php
+++ b/includes/filebackend/lockmanager/DBLockManager.php
@@ -97,7 +97,7 @@
                                // connection timeouts. This is useless if each 
bucket has one peer.
                                try {
                                        $this->statusCache = 
ObjectCache::newAccelerator( array() );
-                               } catch ( MWException $e ) {
+                               } catch ( Exception $e ) {
                                        trigger_error( __CLASS__ .
                                                " using multiple DB peers 
without apc, xcache, or wincache." );
                                }
diff --git a/includes/htmlform/HTMLFormField.php 
b/includes/htmlform/HTMLFormField.php
index 11b88b4..a91f331 100644
--- a/includes/htmlform/HTMLFormField.php
+++ b/includes/htmlform/HTMLFormField.php
@@ -218,7 +218,7 @@
                                default:
                                        throw new MWException( "Unknown 
operation" );
                        }
-               } catch ( MWException $ex ) {
+               } catch ( Exception $ex ) {
                        throw new MWException(
                                "Invalid hide-if specification for 
$this->mName: " .
                                $ex->getMessage() . " in " . var_export( 
$origParams, true ),
diff --git a/includes/installer/DatabaseInstaller.php 
b/includes/installer/DatabaseInstaller.php
index 31b93c8..f36bac1 100644
--- a/includes/installer/DatabaseInstaller.php
+++ b/includes/installer/DatabaseInstaller.php
@@ -305,7 +305,7 @@
                $up = DatabaseUpdater::newForDB( $this->db );
                try {
                        $up->doUpdates();
-               } catch ( MWException $e ) {
+               } catch ( Exception $e ) {
                        echo "\nAn error occurred:\n";
                        echo $e->getText();
                        $ret = false;
diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php
index 381f23c..4159c1d 100644
--- a/includes/installer/Installer.php
+++ b/includes/installer/Installer.php
@@ -1377,7 +1377,7 @@
 
                                try {
                                        $text = Http::get( $url . $file, array( 
'timeout' => 3 ) );
-                               } catch ( MWException $e ) {
+                               } catch ( Exception $e ) {
                                        // Http::get throws with 
allow_url_fopen = false and no curl extension.
                                        $text = null;
                                }
@@ -1753,7 +1753,7 @@
                                false,
                                User::newFromName( 'MediaWiki default' )
                        );
-               } catch ( MWException $e ) {
+               } catch ( Exception $e ) {
                        //using raw, because $wgShowExceptionDetails can not be 
set yet
                        $status->fatal( 'config-install-mainpage-failed', 
$e->getMessage() );
                }
diff --git a/includes/jobqueue/JobQueue.php b/includes/jobqueue/JobQueue.php
index 1f99b1e..53fcaee 100644
--- a/includes/jobqueue/JobQueue.php
+++ b/includes/jobqueue/JobQueue.php
@@ -362,7 +362,7 @@
                                JobQueue::incrStats( 'job-pop-duplicate', 
$this->type, 1, $this->wiki );
                                $job = DuplicateJob::newFromJob( $job ); // 
convert to a no-op
                        }
-               } catch ( MWException $e ) {
+               } catch ( Exception $e ) {
                        // don't lose jobs over this
                }
 
diff --git a/includes/jobqueue/JobRunner.php b/includes/jobqueue/JobRunner.php
index ce3b3ff..d99bfab 100644
--- a/includes/jobqueue/JobRunner.php
+++ b/includes/jobqueue/JobRunner.php
@@ -135,7 +135,7 @@
                                        $status = $job->run();
                                        $error = $job->getLastError();
                                        wfGetLBFactory()->commitMasterChanges();
-                               } catch ( MWException $e ) {
+                               } catch ( Exception $e ) {
                                        
MWExceptionHandler::rollbackMasterChangesAndLog( $e );
                                        $status = false;
                                        $error = get_class( $e ) . ': ' . 
$e->getMessage();
diff --git a/includes/jobqueue/jobs/AssembleUploadChunksJob.php 
b/includes/jobqueue/jobs/AssembleUploadChunksJob.php
index cc28a01..b7f09e7 100644
--- a/includes/jobqueue/jobs/AssembleUploadChunksJob.php
+++ b/includes/jobqueue/jobs/AssembleUploadChunksJob.php
@@ -94,7 +94,7 @@
                                        'status' => Status::newGood()
                                )
                        );
-               } catch ( MWException $e ) {
+               } catch ( Exception $e ) {
                        UploadBase::setSessionStatus(
                                $user,
                                $this->params['filekey'],
diff --git a/includes/jobqueue/jobs/PublishStashedFileJob.php 
b/includes/jobqueue/jobs/PublishStashedFileJob.php
index 55215b3..3d4cfae 100644
--- a/includes/jobqueue/jobs/PublishStashedFileJob.php
+++ b/includes/jobqueue/jobs/PublishStashedFileJob.php
@@ -108,7 +108,7 @@
                                        'status' => Status::newGood()
                                )
                        );
-               } catch ( MWException $e ) {
+               } catch ( Exception $e ) {
                        UploadBase::setSessionStatus(
                                $user,
                                $this->params['filekey'],
diff --git a/includes/media/BMP.php b/includes/media/BMP.php
index d8b0ba6..52f9518 100644
--- a/includes/media/BMP.php
+++ b/includes/media/BMP.php
@@ -71,7 +71,7 @@
                try {
                        $w = wfUnpack( 'V', $w, 4 );
                        $h = wfUnpack( 'V', $h, 4 );
-               } catch ( MWException $e ) {
+               } catch ( Exception $e ) {
                        return false;
                }
 
diff --git a/includes/media/BitmapMetadataHandler.php 
b/includes/media/BitmapMetadataHandler.php
index dd41c38..bb7a1e8 100644
--- a/includes/media/BitmapMetadataHandler.php
+++ b/includes/media/BitmapMetadataHandler.php
@@ -61,7 +61,7 @@
        private function doApp13( $app13 ) {
                try {
                        $this->iptcType = JpegMetadataExtractor::doPSIR( $app13 
);
-               } catch ( MWException $e ) {
+               } catch ( Exception $e ) {
                        // Error reading the iptc hash information.
                        // This probably means the App13 segment is something 
other than what we expect.
                        // However, still try to read it, and treat it as if 
the hash didn't exist.
diff --git a/includes/media/Jpeg.php b/includes/media/Jpeg.php
index 810b9af..5463922 100644
--- a/includes/media/Jpeg.php
+++ b/includes/media/Jpeg.php
@@ -106,7 +106,7 @@
                        $meta['MEDIAWIKI_EXIF_VERSION'] = Exif::version();
 
                        return serialize( $meta );
-               } catch ( MWException $e ) {
+               } catch ( Exception $e ) {
                        // BitmapMetadataHandler throws an exception in certain 
exceptional
                        // cases like if file does not exist.
                        wfDebug( __METHOD__ . ': ' . $e->getMessage() . "\n" );
diff --git a/includes/media/SVG.php b/includes/media/SVG.php
index 3e8d9e5..53abfef 100644
--- a/includes/media/SVG.php
+++ b/includes/media/SVG.php
@@ -362,7 +362,7 @@
                $metadata = array( 'version' => self::SVG_METADATA_VERSION );
                try {
                        $metadata += SVGMetadataExtractor::getMetadata( 
$filename );
-               } catch ( MWException $e ) { // @todo SVG specific exceptions
+               } catch ( Exception $e ) { // @todo SVG specific exceptions
                        // File not found, broken, etc.
                        $metadata['error'] = array(
                                'message' => $e->getMessage(),
diff --git a/includes/media/Tiff.php b/includes/media/Tiff.php
index bea6cab..750528f 100644
--- a/includes/media/Tiff.php
+++ b/includes/media/Tiff.php
@@ -88,7 +88,7 @@
                                $meta['MEDIAWIKI_EXIF_VERSION'] = 
Exif::version();
 
                                return serialize( $meta );
-                       } catch ( MWException $e ) {
+                       } catch ( Exception $e ) {
                                // BitmapMetadataHandler throws an exception in 
certain exceptional
                                // cases like if file does not exist.
                                wfDebug( __METHOD__ . ': ' . $e->getMessage() . 
"\n" );
diff --git a/includes/media/XCF.php b/includes/media/XCF.php
index 48b7a47..6544d5c 100644
--- a/includes/media/XCF.php
+++ b/includes/media/XCF.php
@@ -130,7 +130,7 @@
                                        "/Nbase_type", # /
                                $binaryHeader
                        );
-               } catch ( MWException $mwe ) {
+               } catch ( Exception $mwe ) {
                        return false;
                }
 
diff --git a/includes/media/XMP.php b/includes/media/XMP.php
index 5b46af1..0d341aa 100644
--- a/includes/media/XMP.php
+++ b/includes/media/XMP.php
@@ -316,7 +316,7 @@
                                $this->results = array(); // blank if error.
                                return false;
                        }
-               } catch ( MWException $e ) {
+               } catch ( Exception $e ) {
                        wfDebugLog( 'XMP', 'XMP parse error: ' . $e );
                        $this->results = array();
 
diff --git a/includes/page/Article.php b/includes/page/Article.php
index 5a09e65..438a17c 100644
--- a/includes/page/Article.php
+++ b/includes/page/Article.php
@@ -1594,7 +1594,7 @@
                if ( !$reason ) {
                        try {
                                $reason = $this->generateReason( $hasHistory );
-                       } catch ( MWException $e ) {
+                       } catch ( Exception $e ) {
                                # if a page is horribly broken, we still want 
to be able to
                                # delete it. So be lenient about errors here.
                                wfDebug( "Error while building auto delete 
summary: $e" );
diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php
index 0eeab1c..8373dc0 100644
--- a/includes/page/WikiPage.php
+++ b/includes/page/WikiPage.php
@@ -1844,7 +1844,7 @@
                                                }
                                        }
                                        $user->incEditCount();
-                               } catch ( MWException $e ) {
+                               } catch ( Exception $e ) {
                                        $dbw->rollback( __METHOD__ );
                                        // Question: Would it perhaps be better 
if this method turned all
                                        // exceptions into $status's?
@@ -1947,7 +1947,7 @@
                                }
                                $user->incEditCount();
 
-                       } catch ( MWException $e ) {
+                       } catch ( Exception $e ) {
                                $dbw->rollback( __METHOD__ );
                                throw $e;
                        }
diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php
index 7703c4b..fc7040a 100644
--- a/includes/parser/Parser.php
+++ b/includes/parser/Parser.php
@@ -5285,7 +5285,7 @@
 
                try {
                        $ig = ImageGalleryBase::factory( $mode );
-               } catch ( MWException $e ) {
+               } catch ( Exception $e ) {
                        // If invalid type set, fallback to default.
                        $ig = ImageGalleryBase::factory( false );
                }
diff --git a/includes/specials/SpecialContributions.php 
b/includes/specials/SpecialContributions.php
index c96fd14..c2cd812 100644
--- a/includes/specials/SpecialContributions.php
+++ b/includes/specials/SpecialContributions.php
@@ -969,7 +969,7 @@
                try {
                        $rev = new Revision( $row );
                        $validRevision = (bool)$rev->getId();
-               } catch ( MWException $e ) {
+               } catch ( Exception $e ) {
                        $validRevision = false;
                }
                wfRestoreWarnings();
diff --git a/includes/specials/SpecialImport.php 
b/includes/specials/SpecialImport.php
index 9e9f8c0..aa9b0f4 100644
--- a/includes/specials/SpecialImport.php
+++ b/includes/specials/SpecialImport.php
@@ -194,7 +194,7 @@
                        $reporter->open();
                        try {
                                $importer->doImport();
-                       } catch ( MWException $e ) {
+                       } catch ( Exception $e ) {
                                $exception = $e;
                        }
                        $result = $reporter->close();
diff --git a/includes/specials/SpecialNewimages.php 
b/includes/specials/SpecialNewimages.php
index bc16925..94e77e3 100644
--- a/includes/specials/SpecialNewimages.php
+++ b/includes/specials/SpecialNewimages.php
@@ -141,7 +141,7 @@
                        $mode = $this->getRequest()->getVal( 'gallerymode', 
null );
                        try {
                                $this->gallery = ImageGalleryBase::factory( 
$mode, $this->getContext() );
-                       } catch ( MWException $e ) {
+                       } catch ( Exception $e ) {
                                // User specified something invalid, fallback 
to default.
                                $this->gallery = ImageGalleryBase::factory( 
false, $this->getContext() );
                        }
diff --git a/includes/specials/SpecialRandomInCategory.php 
b/includes/specials/SpecialRandomInCategory.php
index b4af7ba..69436bf 100644
--- a/includes/specials/SpecialRandomInCategory.php
+++ b/includes/specials/SpecialRandomInCategory.php
@@ -230,7 +230,7 @@
                if ( !$this->minTimestamp || !$this->maxTimestamp ) {
                        try {
                                list( $this->minTimestamp, $this->maxTimestamp 
) = $this->getMinAndMaxForCat( $this->category );
-                       } catch ( MWException $e ) {
+                       } catch ( Exception $e ) {
                                // Possibly no entries in category.
                                return false;
                        }
diff --git a/includes/specials/SpecialUpload.php 
b/includes/specials/SpecialUpload.php
index d9e3a67..b965b54 100644
--- a/includes/specials/SpecialUpload.php
+++ b/includes/specials/SpecialUpload.php
@@ -988,7 +988,7 @@
                        $stash = 
RepoGroup::singleton()->getLocalRepo()->getUploadStash();
                        try {
                                $file = $stash->getFile( $this->mSessionKey );
-                       } catch ( MWException $e ) {
+                       } catch ( Exception $e ) {
                                $file = null;
                        }
                        if ( $file ) {
diff --git a/includes/utils/UIDGenerator.php b/includes/utils/UIDGenerator.php
index 33e9116..9241587 100644
--- a/includes/utils/UIDGenerator.php
+++ b/includes/utils/UIDGenerator.php
@@ -281,7 +281,7 @@
                if ( ( $flags & self::QUICK_VOLATILE ) && PHP_SAPI !== 'cli' ) {
                        try {
                                $cache = ObjectCache::newAccelerator( array() );
-                       } catch ( MWException $e ) {
+                       } catch ( Exception $e ) {
                                // not supported
                        }
                }
diff --git a/maintenance/doMaintenance.php b/maintenance/doMaintenance.php
index 6616057..c93a971 100644
--- a/maintenance/doMaintenance.php
+++ b/maintenance/doMaintenance.php
@@ -114,7 +114,7 @@
        $factory = wfGetLBFactory();
        $factory->commitMasterChanges();
        $factory->shutdown();
-} catch ( MWException $mwe ) {
+} catch ( Exception $mwe ) {
        echo $mwe->getText();
        exit( 1 );
 }
diff --git a/maintenance/language/checkLanguage.php 
b/maintenance/language/checkLanguage.php
index ec6e122..bd9f9af 100644
--- a/maintenance/language/checkLanguage.php
+++ b/maintenance/language/checkLanguage.php
@@ -29,6 +29,6 @@
 
 try {
        $cli->execute();
-} catch ( MWException $e ) {
+} catch ( Exception $e ) {
        print 'Error: ' . $e->getMessage() . "\n";
 }
diff --git a/maintenance/populateRevisionSha1.php 
b/maintenance/populateRevisionSha1.php
index f06b56b..b401db0 100644
--- a/maintenance/populateRevisionSha1.php
+++ b/maintenance/populateRevisionSha1.php
@@ -153,7 +153,7 @@
                                ? Revision::newFromArchiveRow( $row )
                                : new Revision( $row );
                        $text = $rev->getSerializedData();
-               } catch ( MWException $e ) {
+               } catch ( Exception $e ) {
                        $this->output( "Data of revision with 
{$idCol}={$row->$idCol} unavailable!\n" );
 
                        return false; // bug 22624?
@@ -182,7 +182,7 @@
                $db = $this->getDB( DB_MASTER );
                try {
                        $rev = Revision::newFromArchiveRow( $row );
-               } catch ( MWException $e ) {
+               } catch ( Exception $e ) {
                        $this->output( "Text of revision with timestamp 
{$row->ar_timestamp} unavailable!\n" );
 
                        return false; // bug 22624?
diff --git a/maintenance/preprocessorFuzzTest.php 
b/maintenance/preprocessorFuzzTest.php
index cb55f0f..e1710c1 100644
--- a/maintenance/preprocessorFuzzTest.php
+++ b/maintenance/preprocessorFuzzTest.php
@@ -64,7 +64,7 @@
                                self::$currentTest = new PPFuzzTest( $this );
                                self::$currentTest->execute();
                                $passed = 'passed';
-                       } catch ( MWException $e ) {
+                       } catch ( Exception $e ) {
                                $testReport = self::$currentTest->getReport();
                                $exceptionReport = $e->getText();
                                $hash = md5( $testReport );

-- 
To view, visit https://gerrit.wikimedia.org/r/184004
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I76601a86e30f4984e3b1a8c8ec5ef5a0f652433a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to