Index: trunk/phase3/includes/api/ApiImport.php |
— | — | @@ -85,15 +85,10 @@ |
86 | 86 | $params['summary'] |
87 | 87 | ); |
88 | 88 | |
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() ) ); |
98 | 93 | } |
99 | 94 | |
100 | 95 | $resultData = $reporter->getData(); |