Merge "WikiImporter: Improve error message output"
This commit is contained in:
commit
ea682628e3
2 changed files with 4 additions and 3 deletions
|
|
@ -709,8 +709,9 @@ class WikiImporter {
|
||||||
'message' => $error->message,
|
'message' => $error->message,
|
||||||
] );
|
] );
|
||||||
} else {
|
} else {
|
||||||
throw new MWException( "Expected <mediawiki> tag, got " .
|
throw new MWException(
|
||||||
$this->reader->localName );
|
"Expected '<mediawiki>' tag, got '<{$this->reader->localName}>' tag."
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->debug( "<mediawiki> tag is correct." );
|
$this->debug( "<mediawiki> tag is correct." );
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ class ImportFailureTest extends MediaWikiLangTestCase {
|
||||||
|
|
||||||
public static function provideImportFailure() {
|
public static function provideImportFailure() {
|
||||||
yield [ 'BadXML', MWException::class, '/^XML error at line 3: Opening and ending tag mismatch:.*$/' ];
|
yield [ 'BadXML', MWException::class, '/^XML error at line 3: Opening and ending tag mismatch:.*$/' ];
|
||||||
yield [ 'MissingMediaWikiTag', MWException::class, '/^Expected <mediawiki> tag, got .*$/' ];
|
yield [ 'MissingMediaWikiTag', MWException::class, "/^Expected '<mediawiki>' tag, got .*$/" ];
|
||||||
yield [ 'MissingMainTextField', MWException::class, '/^Missing text field in import.$/' ];
|
yield [ 'MissingMainTextField', MWException::class, '/^Missing text field in import.$/' ];
|
||||||
yield [ 'MissingSlotTextField', MWException::class, '/^Missing text field in import.$/' ];
|
yield [ 'MissingSlotTextField', MWException::class, '/^Missing text field in import.$/' ];
|
||||||
yield [ 'MissingSlotRole', MWException::class, '/^Missing role for imported slot.$/' ];
|
yield [ 'MissingSlotRole', MWException::class, '/^Missing role for imported slot.$/' ];
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue