$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() );
}
$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__ );
// any knowledge about an URL and throw an exception instead.
try {
$ctx['url'] = urldecode( $wgRequest->getRequestURL() );
- } catch ( MWException $ignored ) {
+ } catch ( Exception $ignored ) {
// no-op
}
try {
$importer->doImport();
- } catch ( MWException $e ) {
+ } catch ( Exception $e ) {
$this->dieUsageMsg( array( 'import-unknownerror', $e->getMessage() ) );
}
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() );
}
}
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() );
}
}
}
} catch ( UploadStashException $e ) {
$this->handleStashException( $e );
- } catch ( MWException $e ) {
+ } catch ( Exception $e ) {
$this->dieUsage( $e->getMessage(), 'stashfailed' );
}
try {
$result['filekey'] = $this->performStash();
$result['sessionkey'] = $result['filekey']; // backwards compatibility
- } catch ( MWException $e ) {
+ } catch ( Exception $e ) {
$result['warnings']['stashfailed'] = $e->getMessage();
}
$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' );
}
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 );
try {
$data['filekey'] = $this->performStash();
$data['sessionkey'] = $data['filekey'];
- } catch ( MWException $e ) {
+ } catch ( Exception $e ) {
$data['stashfailed'] = $e->getMessage();
}
$data['invalidparameter'] = $parameter;
if ( $useFilter ) {
return ( $this->isHit( 'shared', "$virtualKey:$member" ) !== false );
}
- } catch ( MWException $e ) {
+ } catch ( Exception $e ) {
MWExceptionHandler::logException( $e );
return true;
}
}
return $this->add( 'shared', $prefixedMembers );
- } catch ( MWException $e ) {
+ } catch ( Exception $e ) {
MWExceptionHandler::logException( $e );
return false;
}
try {
$error = $this->sourceStream( $fp, $lineCallback, $resultCallback, $fname, $inputCallback );
- } catch ( MWException $e ) {
+ } catch ( Exception $e ) {
fclose( $fp );
throw $e;
}
return;
}
- } catch ( MWException $e ) {
+ } catch ( Exception $e ) {
// Do nothing, just use the default page
}
}
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.
*
* try {
* ...
- * } catch ( MWException $e ) {
+ * } catch ( Exception $e ) {
* $e->report();
* } catch ( Exception $e ) {
* echo $e->__toString();
}
try {
$url = $store->store( $path, $data ); // Try to save the object
- } catch ( MWException $error ) {
+ } catch ( Exception $error ) {
$url = false;
}
if ( strlen( $url ) ) {
$timestamp = new MWTimestamp( $ts );
return $timestamp->getTimestamp( $format );
- } catch ( MWException $e ) {
+ } catch ( Exception $e ) {
throw new FileBackendError( $e->getMessage() );
}
}
// 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." );
}
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 ),
$up = DatabaseUpdater::newForDB( $this->db );
try {
$up->doUpdates();
- } catch ( MWException $e ) {
+ } catch ( Exception $e ) {
echo "\nAn error occurred:\n";
echo $e->getText();
$ret = false;
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;
}
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() );
}
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
}
$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();
'status' => Status::newGood()
)
);
- } catch ( MWException $e ) {
+ } catch ( Exception $e ) {
UploadBase::setSessionStatus(
$user,
$this->params['filekey'],
'status' => Status::newGood()
)
);
- } catch ( MWException $e ) {
+ } catch ( Exception $e ) {
UploadBase::setSessionStatus(
$user,
$this->params['filekey'],
try {
$w = wfUnpack( 'V', $w, 4 );
$h = wfUnpack( 'V', $h, 4 );
- } catch ( MWException $e ) {
+ } catch ( Exception $e ) {
return false;
}
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.
$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" );
$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(),
$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" );
"/Nbase_type", # /
$binaryHeader
);
- } catch ( MWException $mwe ) {
+ } catch ( Exception $mwe ) {
return false;
}
$this->results = array(); // blank if error.
return false;
}
- } catch ( MWException $e ) {
+ } catch ( Exception $e ) {
wfDebugLog( 'XMP', 'XMP parse error: ' . $e );
$this->results = array();
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" );
}
}
$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?
}
$user->incEditCount();
- } catch ( MWException $e ) {
+ } catch ( Exception $e ) {
$dbw->rollback( __METHOD__ );
throw $e;
}
try {
$ig = ImageGalleryBase::factory( $mode );
- } catch ( MWException $e ) {
+ } catch ( Exception $e ) {
// If invalid type set, fallback to default.
$ig = ImageGalleryBase::factory( false );
}
try {
$rev = new Revision( $row );
$validRevision = (bool)$rev->getId();
- } catch ( MWException $e ) {
+ } catch ( Exception $e ) {
$validRevision = false;
}
wfRestoreWarnings();
$reporter->open();
try {
$importer->doImport();
- } catch ( MWException $e ) {
+ } catch ( Exception $e ) {
$exception = $e;
}
$result = $reporter->close();
$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() );
}
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;
}
$stash = RepoGroup::singleton()->getLocalRepo()->getUploadStash();
try {
$file = $stash->getFile( $this->mSessionKey );
- } catch ( MWException $e ) {
+ } catch ( Exception $e ) {
$file = null;
}
if ( $file ) {
if ( ( $flags & self::QUICK_VOLATILE ) && PHP_SAPI !== 'cli' ) {
try {
$cache = ObjectCache::newAccelerator( array() );
- } catch ( MWException $e ) {
+ } catch ( Exception $e ) {
// not supported
}
}
$factory = wfGetLBFactory();
$factory->commitMasterChanges();
$factory->shutdown();
-} catch ( MWException $mwe ) {
+} catch ( Exception $mwe ) {
echo $mwe->getText();
exit( 1 );
}
try {
$cli->execute();
-} catch ( MWException $e ) {
+} catch ( Exception $e ) {
print 'Error: ' . $e->getMessage() . "\n";
}
? 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?
$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?
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 );