Use jQuery 3 .catch( fn ) instead of .then( null, fn )
[lhc/web/wiklou.git] / resources / src / mediawiki / api.js
index 0e9c19b..2fcb4be 100644 (file)
                                        return abortedPromise;
                                }
 
-                               return ( abortable = api.post( params, ajaxOptions ) ).then(
-                                       // If no error, return to caller as-is
-                                       null,
+                               return ( abortable = api.post( params, ajaxOptions ) ).catch(
                                        // Error handler
                                        function ( code ) {
                                                if ( code === 'badtoken' ) {