From: Alexandre Emsenhuber Date: Wed, 24 Nov 2010 11:45:01 +0000 (+0000) Subject: WikiImport no longer returns a WikiError since the rewrite to use XmlReader X-Git-Tag: 1.31.0-rc.0~33748 X-Git-Url: http://git.cyclocoop.org//%22%22._DIR_PLUGIN_FULLCALENDAR.%22prive/themes/spip/images/event_edit.png/%22?a=commitdiff_plain;h=6d333feef4a2e9b62a28168643b6a4a088dbbd0d;p=lhc%2Fweb%2Fwiklou.git WikiImport no longer returns a WikiError since the rewrite to use XmlReader --- diff --git a/includes/api/ApiImport.php b/includes/api/ApiImport.php index 39b991ab03..d6bf328f0e 100644 --- a/includes/api/ApiImport.php +++ b/includes/api/ApiImport.php @@ -85,15 +85,10 @@ class ApiImport extends ApiBase { $params['summary'] ); - $result = $importer->doImport(); - if ( $result instanceof WikiXmlError ) { - $this->dieUsageMsg( array( 'import-xml-error', - $result->mLine, - $result->mColumn, - $result->mByte . $result->mContext, - xml_error_string( $result->mXmlError ) ) ); - } elseif ( WikiError::isError( $result ) ) { - $this->dieUsageMsg( array( 'import-unknownerror', $result->getMessage() ) ); // This shouldn't happen + try { + $importer->doImport(); + } catch ( MWException $e ) { + $this->dieUsageMsg( array( 'import-unknownerror', $e->getMessage() ) ); } $resultData = $reporter->getData();