ApiSandbox: Work around mw.Api treating an empty response as failure
authorBrad Jorsch <bjorsch@wikimedia.org>
Tue, 29 Mar 2016 14:09:14 +0000 (10:09 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Tue, 29 Mar 2016 14:09:14 +0000 (10:09 -0400)
commita299ac05475f1e70844aa5d432d4b07cf6702156
treeeebb58021be5fd2128d97cd286ca252ebc0ecf3b
parent6906de45c1d5edc38a14e9cbbed6337960b1ff0d
ApiSandbox: Work around mw.Api treating an empty response as failure

We use a 'then' function to turn the pseudo-failure back into a success.

This also adjusts mw.Api to pass the actual result and jqXHR to the
failure function for non-HTTP errors. Sadly the existing parameters
passed on failure are something of a big mess, so this isn't as nice as
it might otherwise be to preserve compatibility.

Bug: T131129
Change-Id: Ic5da24edeac6285fbce0785f0789dddcd2dc15a9
resources/src/mediawiki.special/mediawiki.special.apisandbox.js
resources/src/mediawiki/api.js