mw.api.postWithToken now forwards promise on fail if we have token
[lhc/web/wiklou.git] / resources / mediawiki.api / mediawiki.api.js
index f9a14b0..cdc6767 100644 (file)
                                                        tokenCache[tokenType] = params.token = undefined;
                                                        return api.post( params );
                                                }
+                                               // Pass the promise forward, so the caller gets error codes
+                                               return this;
                                        }
                                );
                        } else {