mediawiki.api: Actually don't log request error 'abort'
authorBartosz Dziewoński <matma.rex@gmail.com>
Sat, 30 Aug 2014 15:26:31 +0000 (17:26 +0200)
committerKrinkle <krinklemail@gmail.com>
Fri, 5 Sep 2014 16:39:24 +0000 (16:39 +0000)
173930cb32, once more, with feeling. I'm not sure why the previous
version has ever worked, given that our own code (a few lines above
this, starting from '// Make the AJAX request') is written in such a
way that `code` can never be `'abort'`.

Bug: 65442
Change-Id: I34bcaa362806bf9e80fb40bc92723f85bea1fb64

resources/src/mediawiki.api/mediawiki.api.js

index f8dc836..51b3238 100644 (file)
 
                        // Return the Promise
                        return apiDeferred.promise( { abort: xhr.abort } ).fail( function ( code, details ) {
-                               if ( code !== 'abort' ) {
+                               if ( !( code === 'http' && details && details.textStatus === 'abort' ) ) {
                                        mw.log( 'mw.Api error: ', code, details );
                                }
                        } );