From: Aaron Schulz Date: Fri, 9 Jan 2015 23:44:47 +0000 (-0800) Subject: Updated some try-catch statements: MWException -> Exception X-Git-Tag: 1.31.0-rc.0~12729 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=69217704148a5751754fb1b9587e7f6d5c774b13;p=lhc%2Fweb%2Fwiklou.git Updated some try-catch statements: MWException -> Exception Change-Id: I76601a86e30f4984e3b1a8c8ec5ef5a0f652433a --- diff --git a/includes/CategoryViewer.php b/includes/CategoryViewer.php index 4d23ed2e48..1a09d44649 100644 --- a/includes/CategoryViewer.php +++ b/includes/CategoryViewer.php @@ -152,7 +152,7 @@ class CategoryViewer extends ContextSource { $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 1c709e6253..c1d14db0a6 100644 --- a/includes/FileDeleteForm.php +++ b/includes/FileDeleteForm.php @@ -201,7 +201,7 @@ class FileDeleteForm { $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 f516759b59..a1c39fb217 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1328,7 +1328,7 @@ function wfLogProfilingData() { // 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 a1340743e2..c7dcce8958 100644 --- a/includes/api/ApiImport.php +++ b/includes/api/ApiImport.php @@ -79,7 +79,7 @@ class ApiImport extends ApiBase { 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 cdc61cd5a7..b6ef60460f 100644 --- a/includes/api/ApiQueryRecentChanges.php +++ b/includes/api/ApiQueryRecentChanges.php @@ -178,7 +178,7 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase { 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/ApiQueryWatchlist.php b/includes/api/ApiQueryWatchlist.php index 4059ff86fb..6e60fe465e 100644 --- a/includes/api/ApiQueryWatchlist.php +++ b/includes/api/ApiQueryWatchlist.php @@ -199,7 +199,7 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { 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 43e4c61e0c..d6ad7f382d 100644 --- a/includes/api/ApiUpload.php +++ b/includes/api/ApiUpload.php @@ -161,7 +161,7 @@ class ApiUpload extends ApiBase { } } catch ( UploadStashException $e ) { $this->handleStashException( $e ); - } catch ( MWException $e ) { + } catch ( Exception $e ) { $this->dieUsage( $e->getMessage(), 'stashfailed' ); } @@ -182,7 +182,7 @@ class ApiUpload extends ApiBase { 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 @@ class ApiUpload extends ApiBase { $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 @@ class ApiUpload extends ApiBase { 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 @@ class ApiUpload extends ApiBase { 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 2720933464..6ecaacb8d4 100644 --- a/includes/cache/bloom/BloomCache.php +++ b/includes/cache/bloom/BloomCache.php @@ -114,7 +114,7 @@ abstract class BloomCache { if ( $useFilter ) { return ( $this->isHit( 'shared', "$virtualKey:$member" ) !== false ); } - } catch ( MWException $e ) { + } catch ( Exception $e ) { MWExceptionHandler::logException( $e ); return true; } @@ -143,7 +143,7 @@ abstract class BloomCache { } 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 0b022d139e..054f27a909 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -3962,7 +3962,7 @@ abstract class DatabaseBase implements IDatabase { 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 2393bbbd47..86950a89a9 100644 --- a/includes/db/DatabaseError.php +++ b/includes/db/DatabaseError.php @@ -229,7 +229,7 @@ class DBConnectionError extends DBExpectedError { 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 93c53adbb1..42816ddcb5 100644 --- a/includes/deferred/DeferredUpdates.php +++ b/includes/deferred/DeferredUpdates.php @@ -107,7 +107,7 @@ class DeferredUpdates { 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 ad462f27a0..5ea9359826 100644 --- a/includes/exception/MWExceptionHandler.php +++ b/includes/exception/MWExceptionHandler.php @@ -142,7 +142,7 @@ class MWExceptionHandler { * * 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 688130e03f..ea04cc8566 100644 --- a/includes/externalstore/ExternalStore.php +++ b/includes/externalstore/ExternalStore.php @@ -197,7 +197,7 @@ class ExternalStore { } 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 4fde1248e0..2637b5aecc 100644 --- a/includes/filebackend/SwiftFileBackend.php +++ b/includes/filebackend/SwiftFileBackend.php @@ -647,7 +647,7 @@ class SwiftFileBackend extends FileBackendStore { $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 affcf440c6..39a55635c0 100644 --- a/includes/filebackend/lockmanager/DBLockManager.php +++ b/includes/filebackend/lockmanager/DBLockManager.php @@ -97,7 +97,7 @@ abstract class DBLockManager extends QuorumLockManager { // 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 11b88b4443..a91f331949 100644 --- a/includes/htmlform/HTMLFormField.php +++ b/includes/htmlform/HTMLFormField.php @@ -218,7 +218,7 @@ abstract class HTMLFormField { 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 31b93c8855..f36bac10f5 100644 --- a/includes/installer/DatabaseInstaller.php +++ b/includes/installer/DatabaseInstaller.php @@ -305,7 +305,7 @@ abstract class DatabaseInstaller { $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 381f23ce16..4159c1dc34 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -1377,7 +1377,7 @@ abstract class Installer { 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 @@ abstract class Installer { 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 1f99b1ee82..53fcaeeda0 100644 --- a/includes/jobqueue/JobQueue.php +++ b/includes/jobqueue/JobQueue.php @@ -362,7 +362,7 @@ abstract class JobQueue { 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 ce3b3ffa03..d99bfabae1 100644 --- a/includes/jobqueue/JobRunner.php +++ b/includes/jobqueue/JobRunner.php @@ -135,7 +135,7 @@ class JobRunner { $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 cc28a019c0..b7f09e7768 100644 --- a/includes/jobqueue/jobs/AssembleUploadChunksJob.php +++ b/includes/jobqueue/jobs/AssembleUploadChunksJob.php @@ -94,7 +94,7 @@ class AssembleUploadChunksJob extends Job { '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 55215b3e36..3d4cfae7fe 100644 --- a/includes/jobqueue/jobs/PublishStashedFileJob.php +++ b/includes/jobqueue/jobs/PublishStashedFileJob.php @@ -108,7 +108,7 @@ class PublishStashedFileJob extends Job { '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 d8b0ba641d..52f9518f79 100644 --- a/includes/media/BMP.php +++ b/includes/media/BMP.php @@ -71,7 +71,7 @@ class BmpHandler extends BitmapHandler { 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 dd41c388cd..bb7a1e834e 100644 --- a/includes/media/BitmapMetadataHandler.php +++ b/includes/media/BitmapMetadataHandler.php @@ -61,7 +61,7 @@ class BitmapMetadataHandler { 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 810b9af608..5463922b14 100644 --- a/includes/media/Jpeg.php +++ b/includes/media/Jpeg.php @@ -106,7 +106,7 @@ class JpegHandler extends ExifBitmapHandler { $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 3e8d9e5e8b..53abfef04a 100644 --- a/includes/media/SVG.php +++ b/includes/media/SVG.php @@ -362,7 +362,7 @@ class SvgHandler extends ImageHandler { $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 bea6cab365..750528f0f7 100644 --- a/includes/media/Tiff.php +++ b/includes/media/Tiff.php @@ -88,7 +88,7 @@ class TiffHandler extends ExifBitmapHandler { $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 48b7a47c40..6544d5cf34 100644 --- a/includes/media/XCF.php +++ b/includes/media/XCF.php @@ -130,7 +130,7 @@ class XCFHandler extends BitmapHandler { "/Nbase_type", # / $binaryHeader ); - } catch ( MWException $mwe ) { + } catch ( Exception $mwe ) { return false; } diff --git a/includes/media/XMP.php b/includes/media/XMP.php index 5b46af1e93..0d341aaa1d 100644 --- a/includes/media/XMP.php +++ b/includes/media/XMP.php @@ -316,7 +316,7 @@ class XMPReader { $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 5a09e656b5..438a17cbf9 100644 --- a/includes/page/Article.php +++ b/includes/page/Article.php @@ -1594,7 +1594,7 @@ class Article implements Page { 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 0eeab1cffa..8373dc01b1 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -1844,7 +1844,7 @@ class WikiPage implements Page, IDBAccessObject { } } $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 @@ class WikiPage implements Page, IDBAccessObject { } $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 7703c4bb22..fc7040a0e1 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -5285,7 +5285,7 @@ class Parser { 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 c96fd14ba9..c2cd8122d6 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -969,7 +969,7 @@ class ContribsPager extends ReverseChronologicalPager { 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 9e9f8c083e..aa9b0f4263 100644 --- a/includes/specials/SpecialImport.php +++ b/includes/specials/SpecialImport.php @@ -194,7 +194,7 @@ class SpecialImport extends SpecialPage { $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 bc16925b0a..94e77e3f64 100644 --- a/includes/specials/SpecialNewimages.php +++ b/includes/specials/SpecialNewimages.php @@ -141,7 +141,7 @@ class NewFilesPager extends ReverseChronologicalPager { $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 b4af7ba249..69436bf79d 100644 --- a/includes/specials/SpecialRandomInCategory.php +++ b/includes/specials/SpecialRandomInCategory.php @@ -230,7 +230,7 @@ class SpecialRandomInCategory extends FormSpecialPage { 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 d9e3a67393..b965b54667 100644 --- a/includes/specials/SpecialUpload.php +++ b/includes/specials/SpecialUpload.php @@ -988,7 +988,7 @@ class UploadForm extends HTMLForm { $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 33e9116b29..92415877f7 100644 --- a/includes/utils/UIDGenerator.php +++ b/includes/utils/UIDGenerator.php @@ -281,7 +281,7 @@ class UIDGenerator { 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 6616057661..c93a971394 100644 --- a/maintenance/doMaintenance.php +++ b/maintenance/doMaintenance.php @@ -114,7 +114,7 @@ try { $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 ec6e12268a..bd9f9af8c5 100644 --- a/maintenance/language/checkLanguage.php +++ b/maintenance/language/checkLanguage.php @@ -29,6 +29,6 @@ $cli = new CheckLanguageCLI( $options ); 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 f06b56be77..b401db0377 100644 --- a/maintenance/populateRevisionSha1.php +++ b/maintenance/populateRevisionSha1.php @@ -153,7 +153,7 @@ class PopulateRevisionSha1 extends LoggedUpdateMaintenance { ? 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 @@ class PopulateRevisionSha1 extends LoggedUpdateMaintenance { $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 cb55f0f263..e1710c142a 100644 --- a/maintenance/preprocessorFuzzTest.php +++ b/maintenance/preprocessorFuzzTest.php @@ -64,7 +64,7 @@ class PPFuzzTester { 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 );