From 6d333feef4a2e9b62a28168643b6a4a088dbbd0d Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Wed, 24 Nov 2010 11:45:01 +0000 Subject: [PATCH] WikiImport no longer returns a WikiError since the rewrite to use XmlReader --- includes/api/ApiImport.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) 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(); -- 2.20.1