- return new WikiXmlError( $parser, 'XML import parse failure', $chunk, $offset );
+
+ $byte = xml_get_current_byte_index( $parser );
+ $msg = wfMsgHtml( 'xml-error-string',
+ 'XML import parse failure',
+ xml_get_current_line_number( $parser ),
+ xml_get_current_column_number( $parser ),
+ $byte . ( is_null( $chunk ) ? null : ( '; "' . substr( $chunk, $byte -$offset, 16 ) . '"' ) ),
+ xml_error_string( xml_get_error_code( $parser ) ) );
+
+ xml_parser_free( $parser );
+
+ throw new MWException( $msg );