mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Scribunto
synced 2024-11-27 17:50:06 +00:00
Update for API error i18n
See Iae0e2ce3. Change-Id: I1642929fa48e5354217e0c6de19b4f80b38d94f0
This commit is contained in:
parent
eb8699aef6
commit
c69e2e5049
|
@ -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