Merge "ApiVisualEditor: Replace use of ApiBase::dieUsage() with ::dieWithError()"

This commit is contained in:
jenkins-bot 2018-03-14 09:29:18 +00:00 committed by Gerrit Code Review
commit 670f39790f
3 changed files with 3 additions and 5 deletions

View file

@ -23,6 +23,7 @@
"apierror-visualeditor-difffailed": "Diff failed",
"apierror-visualeditor-docserver-http-error": "$1",
"apierror-visualeditor-docserver-http": "HTTP $1",
"apierror-visualeditor-docserver-unconfigured": "The VirtualRESTService for the document server is not defined; see https://www.mediawiki.org/wiki/Extension:VisualEditor",
"apierror-visualeditor-docserver": "Error contacting the Parsoid/RESTbase server",
"apierror-visualeditor-invaliddeflate": "Content provided is not properly deflated",
"apierror-visualeditor-latestnotfound": "Could not find latest revision for title",

View file

@ -36,6 +36,7 @@
"apierror-visualeditor-difffailed": "{{doc-apierror}}",
"apierror-visualeditor-docserver-http-error": "{{doc-apierror}}\n\nParameters:\n* $1 - Error message, probably in English",
"apierror-visualeditor-docserver-http": "{{doc-apierror}}\n\nParameters:\n* $1 - HTTP status code (numeric)",
"apierror-visualeditor-docserver-unconfigured": "{{doc-apierror}}",
"apierror-visualeditor-docserver": "{{doc-apierror}}",
"apierror-visualeditor-invaliddeflate": "{{doc-apierror}}",
"apierror-visualeditor-latestnotfound": "{{doc-apierror}}",

View file

@ -57,11 +57,7 @@ class ApiVisualEditor extends ApiBase {
$params['restbaseCompat'] = true;
} else {
// No global modules defined, so no way to contact the document server.
$this->dieUsage(
'The VirtualRESTService for the document server is not defined; see ' .
'https://www.mediawiki.org/wiki/Extension:VisualEditor',
'no_vrs'
);
$this->dieWithError( 'apierror-visualeditor-docserver-unconfigured', 'no_vrs' );
}
// merge the global and service-specific params
if ( isset( $vrs['global'] ) ) {