From 05259c3de45027a73eb2b574c0511ca8c560860e Mon Sep 17 00:00:00 2001 From: Matthias Mullie Date: Thu, 29 Jun 2017 15:06:51 +0200 Subject: [PATCH] Improve error messages for (known unknown) network errors Bug: T132611 Change-Id: I22f26e56e089edad7c423ac8f0007b5439de3e58 --- includes/api/i18n/en.json | 2 ++ includes/api/i18n/qqq.json | 2 ++ resources/Resources.php | 2 ++ .../mediawiki/mediawiki.Upload.BookletLayout.js | 17 +++++++++++++++-- 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/includes/api/i18n/en.json b/includes/api/i18n/en.json index 9ce10b9870..3d4a100419 100644 --- a/includes/api/i18n/en.json +++ b/includes/api/i18n/en.json @@ -1751,6 +1751,7 @@ "apierror-notarget": "You have not specified a valid target for this action.", "apierror-notpatrollable": "The revision r$1 can't be patrolled as it's too old.", "apierror-nouploadmodule": "No upload module set.", + "apierror-offline": "Could not proceed due to network connectivity issues. Make sure you have a working internet connection and try again.", "apierror-opensearch-json-warnings": "Warnings cannot be represented in OpenSearch JSON format.", "apierror-pagecannotexist": "Namespace doesn't allow actual pages.", "apierror-pagedeleted": "The page has been deleted since you fetched its timestamp.", @@ -1801,6 +1802,7 @@ "apierror-stashzerolength": "File is of zero length, and could not be stored in the stash: $1.", "apierror-systemblocked": "You have been blocked automatically by MediaWiki.", "apierror-templateexpansion-notwikitext": "Template expansion is only supported for wikitext content. $1 uses content model $2.", + "apierror-timeout": "The server did not respond within the expected time.", "apierror-toofewexpiries": "$1 expiry {{PLURAL:$1|timestamp was|timestamps were}} provided where $2 {{PLURAL:$2|was|were}} needed.", "apierror-unknownaction": "The action specified, $1, is not recognized.", "apierror-unknownerror-editpage": "Unknown EditPage error: $1.", diff --git a/includes/api/i18n/qqq.json b/includes/api/i18n/qqq.json index 27d10d5b85..04bcb88f80 100644 --- a/includes/api/i18n/qqq.json +++ b/includes/api/i18n/qqq.json @@ -1640,6 +1640,7 @@ "apierror-notarget": "{{doc-apierror}}", "apierror-notpatrollable": "{{doc-apierror}}\n\nParameters:\n* $1 - Revision ID number.", "apierror-nouploadmodule": "{{doc-apierror}}", + "apierror-offline": "Error message for when files could not be uploaded as a result of bad/lost internet connection.", "apierror-opensearch-json-warnings": "{{doc-apierror}}", "apierror-pagecannotexist": "{{doc-apierror}}", "apierror-pagedeleted": "{{doc-apierror}}", @@ -1690,6 +1691,7 @@ "apierror-stashzerolength": "{{doc-apierror}}\n\nParameters:\n* $1 - Exception text. Currently this is probably English, hopefully we'll fix that in the future.", "apierror-systemblocked": "{{doc-apierror}}", "apierror-templateexpansion-notwikitext": "{{doc-apierror}}\n\nParameters:\n* $1 - Page title.\n* $2 - Content model.", + "apierror-timeout": "API error message that can be used for client side localisation of API errors.", "apierror-toofewexpiries": "{{doc-apierror}}\n\nParameters:\n* $1 - Number provided.\n* $2 - Number needed.", "apierror-unknownaction": "{{doc-apierror}}\n\nParameters:\n* $1 - Action provided.", "apierror-unknownerror-editpage": "{{doc-apierror}}\n\nParameters:\n* $1 - Error code (an integer).", diff --git a/resources/Resources.php b/resources/Resources.php index 4176fe6571..156f967053 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -1293,6 +1293,8 @@ return [ 'action-upload', 'apierror-mustbeloggedin', 'badaccess-groups', + 'apierror-timeout', + 'apierror-offline', 'apierror-unknownerror', 'api-error-unknown-warning', 'fileexists', diff --git a/resources/src/mediawiki/mediawiki.Upload.BookletLayout.js b/resources/src/mediawiki/mediawiki.Upload.BookletLayout.js index 3fcbb3f460..c58af4f5b9 100644 --- a/resources/src/mediawiki/mediawiki.Upload.BookletLayout.js +++ b/resources/src/mediawiki/mediawiki.Upload.BookletLayout.js @@ -330,13 +330,26 @@ stateDetails = this.upload.getStateDetails(), error = stateDetails.errors ? stateDetails.errors[ 0 ] : false, warnings = stateDetails.upload && stateDetails.upload.warnings, - $ul = $( '