Testing another issue, by uploading an invalid XML file I got an error of `Import failed: Expected <mediawiki> tag, got script`.
It wasn't obvious that the error message was all there due to a lack of any trailing punctuation or similar.
See also: {T259527}, which highlights the error too (though, is presumably about the import actually failing, and the lack of anything identified).
```lang=php
if ( $this->reader->localName != 'mediawiki' ) {
// phpcs:ignore Generic.PHP.NoSilencedErrors
@libxml_disable_entity_loader( $oldDisable );
$error = libxml_get_last_error();
if ( $error ) {
throw new NormalizedException( "XML error at line {line}: {message}", [
'line' => $error->line,
'message' => $error->message,
] );
} else {
throw new MWException( "Expected <mediawiki> tag, got " .
$this->reader->localName );
}
}
```
Looks like ""XML error at line {line}: {message}"" could be similarly confusing from a lack of termination.