mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Scribunto
synced 2024-11-29 02:24:19 +00:00
Merge "Update for API error i18n"
This commit is contained in:
commit
83e173625c
|
@ -13,7 +13,11 @@ class ApiScribuntoConsole extends ApiBase {
|
|||
|
||||
$title = Title::newFromText( $params['title'] );
|
||||
if ( !$title ) {
|
||||
$this->dieUsageMsg( array( 'invalidtitle', $params['title'] ) );
|
||||
if ( is_callable( array( $this, 'dieWithError' ) ) ) {
|
||||
$this->dieWithError( array( 'apierror-invalidtitle', wfEscapeWikiText( $params['title'] ) ) );
|
||||
} else {
|
||||
$this->dieUsageMsg( array( 'invalidtitle', $params['title'] ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( $params['session'] ) {
|
||||
|
@ -55,10 +59,14 @@ class ApiScribuntoConsole extends ApiBase {
|
|||
}
|
||||
|
||||
if ( $newSession['size'] > self::SC_MAX_SIZE ) {
|
||||
$this->dieUsage(
|
||||
$this->msg( 'scribunto-console-too-large' )->text(),
|
||||
'scribunto-console-too-large'
|
||||
);
|
||||
if ( is_callable( array( $this, 'dieWithError' ) ) ) {
|
||||
$this->dieWithError( 'scribunto-console-too-large' );
|
||||
} else {
|
||||
$this->dieUsage(
|
||||
$this->msg( 'scribunto-console-too-large' )->text(),
|
||||
'scribunto-console-too-large'
|
||||
);
|
||||
}
|
||||
}
|
||||
$result = $this->runConsole( array(
|
||||
'title' => $title,
|
||||
|
|
Loading…
Reference in a new issue