r77229 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77228‎ | r77229 | r77230 >
Date:11:45, 24 November 2010
Author:ialex
Status:ok
Tags:
Comment:
WikiImport no longer returns a WikiError since the rewrite to use XmlReader
Modified paths:
  • /trunk/phase3/includes/api/ApiImport.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiImport.php
@@ -85,15 +85,10 @@
8686 $params['summary']
8787 );
8888
89 - $result = $importer->doImport();
90 - if ( $result instanceof WikiXmlError ) {
91 - $this->dieUsageMsg( array( 'import-xml-error',
92 - $result->mLine,
93 - $result->mColumn,
94 - $result->mByte . $result->mContext,
95 - xml_error_string( $result->mXmlError ) ) );
96 - } elseif ( WikiError::isError( $result ) ) {
97 - $this->dieUsageMsg( array( 'import-unknownerror', $result->getMessage() ) ); // This shouldn't happen
 89+ try {
 90+ $importer->doImport();
 91+ } catch ( MWException $e ) {
 92+ $this->dieUsageMsg( array( 'import-unknownerror', $e->getMessage() ) );
9893 }
9994
10095 $resultData = $reporter->getData();

Status & tagging log