r84308 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84307‎ | r84308 | r84309 >
Date:04:00, 19 March 2011
Author:neilk
Status:deferred
Tags:
Comment:
handle errors that might arise when checking destination filename for uniqueness
Modified paths:
  • /trunk/extensions/UploadWizard/resources/mw.DestinationChecker.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/resources/mw.DestinationChecker.js
@@ -126,8 +126,8 @@
127127 'iiurlwidth': 150
128128 };
129129
130 - // Do the destination check
131 - _this.api.get( params, function( data ) {
 130+
 131+ var ok = function( data ) {
132132 // Remove spinner
133133 _this.spinner( false );
134134
@@ -138,7 +138,7 @@
139139
140140 if ( !data || !data.query || !data.query.pages ) {
141141 // Ignore a null result
142 - mw.log("mw.DestinationChecker::checkUnique> No data in checkUnique result");
 142+ mw.log("mw.DestinationChecker::checkUnique> No data in checkUnique result", 'debug');
143143 return;
144144 }
145145
@@ -181,7 +181,16 @@
182182 _this.processResult( result );
183183 }
184184
185 - } );
 185+ };
 186+
 187+ var err = function( code, result ) {
 188+ _this.spinner( false );
 189+ mw.log("mw.DestinationChecker::checkUnique> error in checkUnique result: " + code, 'debug');
 190+ return;
 191+ };
 192+
 193+ // Do the destination check
 194+ _this.api.get( params, { ok: ok, err: err } );
186195 }
187196
188197 };

Status & tagging log