From 8fe5bbe39bf343a1fd781d0de4b423b405d607c3 Mon Sep 17 00:00:00 2001 From: Alex Monk Date: Wed, 4 Jan 2017 14:59:51 +0000 Subject: [PATCH] More error handling fixes See T154565 Change-Id: I073aae149497342157503ad3f465b7d57aaad4fa --- ApiVisualEditor.php | 4 ++-- modules/ve-mw/i18n/en.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ApiVisualEditor.php b/ApiVisualEditor.php index 48d650c32a..8924d4855c 100644 --- a/ApiVisualEditor.php +++ b/ApiVisualEditor.php @@ -113,12 +113,12 @@ class ApiVisualEditor extends ApiBase { } elseif ( $response['error'] !== '' ) { $this->dieWithError( [ 'apierror-visualeditor-docserver-http-error', wfEscapeWikiText( $response['error'] ) ], - $response['error'] + 'apierror-visualeditor-docserver-http-error' ); } else { // error null, code not 200 $this->dieWithError( [ 'apierror-visualeditor-docserver-http', $response['code'] ], - (string) $response['code'] + 'apierror-visualeditor-docserver-http' ); } return $response['body']; diff --git a/modules/ve-mw/i18n/en.json b/modules/ve-mw/i18n/en.json index bc04df421c..9aa6c6b608 100644 --- a/modules/ve-mw/i18n/en.json +++ b/modules/ve-mw/i18n/en.json @@ -54,8 +54,8 @@ "apierror-visualeditor-badcachekey": "No cached serialization found with that key", "apierror-visualeditor-difffailed": "Diff failed", "apierror-visualeditor-docserver": "Error contacting the Parsoid/RESTbase server", - "apierror-visualeditor-docserver-http": "docserver-http: HTTP $1", - "apierror-visualeditor-docserver-http-error": "docserver-http-error: $1", + "apierror-visualeditor-docserver-http": "HTTP $1", + "apierror-visualeditor-docserver-http-error": "$1", "apierror-visualeditor-invaliddeflate": "Content provided is not properly deflated", "apierror-visualeditor-latestnotfound": "Could not find latest revision for title", "tooltip-ca-createsource": "Create the source code of this page",