Index: trunk/extensions/UploadWizard/UploadWizardHooks.php |
— | — | @@ -125,7 +125,8 @@ |
126 | 126 | 'mwe-upwiz-api-error-overwrite', |
127 | 127 | 'mwe-upwiz-api-error-badtoken', |
128 | 128 | 'mwe-upwiz-api-error-fetchfileerror', |
129 | | - 'mwe-upwiz-api-warning-duplicate', |
| 129 | + 'mwe-upwiz-api-error-duplicate', |
| 130 | + 'mwe-upwiz-api-error-timeout', |
130 | 131 | 'mwe-upwiz-api-warning-exists', |
131 | 132 | 'mwe-upwiz-tutorial-error-localized-file-missing', |
132 | 133 | 'mwe-upwiz-tutorial-error-file-missing', |
Index: trunk/extensions/UploadWizard/UploadWizard.i18n.php |
— | — | @@ -57,7 +57,8 @@ |
58 | 58 | 'mwe-upwiz-api-error-overwrite' => 'Overwriting an existing file is not allowed.', |
59 | 59 | 'mwe-upwiz-api-error-badtoken' => 'Internal error: bad token.', |
60 | 60 | '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.', |
62 | 63 | 'mwe-upwiz-api-warning-exists' => 'There is another file already on the wiki with the same filename', |
63 | 64 | 'mwe-upwiz-tutorial-error-localized-file-missing' => 'Sorry, we could not find a tutorial in your language. The English one is shown instead.', |
64 | 65 | '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 @@ |
192 | 192 | // is this an error that we expect to have a message for? |
193 | 193 | var msgKey = 'mwe-upwiz-api-error-unknown-code'; |
194 | 194 | var args = [ code ]; |
| 195 | + |
| 196 | + if ( code === 'http' && info.textStatus === 'timeout' ) { |
| 197 | + code = 'timeout'; |
| 198 | + } |
| 199 | + |
195 | 200 | if ( $j.inArray( code, mw.Api.errors ) !== -1 ) { |
196 | 201 | msgKey = 'mwe-upwiz-api-error-' + code; |
197 | 202 | args = $j.makeArray( info ); |
Index: trunk/extensions/UploadWizard/resources/mw.Api.js |
— | — | @@ -156,6 +156,9 @@ |
157 | 157 | /* occurs when POST aborted - jQuery 1.4 can't distinguish abort or lost connection from 200 OK + empty result */ |
158 | 158 | 'ok-but-empty', |
159 | 159 | |
| 160 | + // timeout |
| 161 | + 'timeout', |
| 162 | + |
160 | 163 | /* really a warning, but we treat it like an error */ |
161 | 164 | 'duplicate', |
162 | 165 | |