From af628c514103163e2d8a75915140602d4c0130a7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Tue, 22 Oct 2013 09:50:05 +0000 Subject: [PATCH] mw.api.postWithToken now forwards promise on fail if we have token Without this fix the callers of this function could not read the failure code and result, because we returned undefined. Because we are using a filter function, we need to explicitly return the promise to pass it forward. Change-Id: I71984ac827618459f723b0b9f47d4dc29e2a2f70 --- resources/mediawiki.api/mediawiki.api.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/mediawiki.api/mediawiki.api.js b/resources/mediawiki.api/mediawiki.api.js index f9a14b075d..cdc67679f4 100644 --- a/resources/mediawiki.api/mediawiki.api.js +++ b/resources/mediawiki.api/mediawiki.api.js @@ -206,6 +206,8 @@ tokenCache[tokenType] = params.token = undefined; return api.post( params ); } + // Pass the promise forward, so the caller gets error codes + return this; } ); } else { -- 2.20.1