r84226 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84225‎ | r84226 | r84227 >
Date:02:52, 18 March 2011
Author:neilk
Status:deferred
Tags:
Comment:
deal with timeout and duplicate errors
Modified paths:
  • /trunk/extensions/UploadWizard/UploadWizard.i18n.php (modified) (history)
  • /trunk/extensions/UploadWizard/UploadWizardHooks.php (modified) (history)
  • /trunk/extensions/UploadWizard/resources/mw.Api.js (modified) (history)
  • /trunk/extensions/UploadWizard/resources/mw.UploadWizardUploadInterface.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/UploadWizardHooks.php
@@ -125,7 +125,8 @@
126126 'mwe-upwiz-api-error-overwrite',
127127 'mwe-upwiz-api-error-badtoken',
128128 'mwe-upwiz-api-error-fetchfileerror',
129 - 'mwe-upwiz-api-warning-duplicate',
 129+ 'mwe-upwiz-api-error-duplicate',
 130+ 'mwe-upwiz-api-error-timeout',
130131 'mwe-upwiz-api-warning-exists',
131132 'mwe-upwiz-tutorial-error-localized-file-missing',
132133 'mwe-upwiz-tutorial-error-file-missing',
Index: trunk/extensions/UploadWizard/UploadWizard.i18n.php
@@ -57,7 +57,8 @@
5858 'mwe-upwiz-api-error-overwrite' => 'Overwriting an existing file is not allowed.',
5959 'mwe-upwiz-api-error-badtoken' => 'Internal error: bad token.',
6060 'mwe-upwiz-api-error-fetchfileerror' => 'Internal error: something went wrong while fetching the file.',
61 - 'mwe-upwiz-api-warning-duplicate' => 'There is another file already on the wiki with the same content',
 61+ 'mwe-upwiz-api-error-duplicate' => 'There is [$1 another file] already on the wiki with the same content',
 62+ 'mwe-upwiz-api-error-timeout' => 'The server did not respond within the expected time.',
6263 'mwe-upwiz-api-warning-exists' => 'There is another file already on the wiki with the same filename',
6364 'mwe-upwiz-tutorial-error-localized-file-missing' => 'Sorry, we could not find a tutorial in your language. The English one is shown instead.',
6465 'mwe-upwiz-tutorial-error-file-missing' => 'Sorry, we could not find any files for the tutorial that is supposed to go here. Please contact the system administrators.',
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizardUploadInterface.js
@@ -191,6 +191,11 @@
192192 // is this an error that we expect to have a message for?
193193 var msgKey = 'mwe-upwiz-api-error-unknown-code';
194194 var args = [ code ];
 195+
 196+ if ( code === 'http' && info.textStatus === 'timeout' ) {
 197+ code = 'timeout';
 198+ }
 199+
195200 if ( $j.inArray( code, mw.Api.errors ) !== -1 ) {
196201 msgKey = 'mwe-upwiz-api-error-' + code;
197202 args = $j.makeArray( info );
Index: trunk/extensions/UploadWizard/resources/mw.Api.js
@@ -156,6 +156,9 @@
157157 /* occurs when POST aborted - jQuery 1.4 can't distinguish abort or lost connection from 200 OK + empty result */
158158 'ok-but-empty',
159159
 160+ // timeout
 161+ 'timeout',
 162+
160163 /* really a warning, but we treat it like an error */
161164 'duplicate',
162165

Status & tagging log