ApiSandbox: Fix HTTP error handling
authorBrad Jorsch <bjorsch@wikimedia.org>
Sat, 20 May 2017 10:09:20 +0000 (12:09 +0200)
committerBrad Jorsch <bjorsch@wikimedia.org>
Sat, 20 May 2017 11:21:56 +0000 (13:21 +0200)
commitc7e60349bf41020e9974d5199872da1fdbf5212e
tree03ffc9629d5ae7bcd5188104157621aaac94aa68
parent0be08c438f92095fbdcb45b870615c4e7eef4e01
ApiSandbox: Fix HTTP error handling

Since bf69459, ApiSandbox seems to stall out when an API request
results in an HTTP error (e.g. due to a PHP fatal error). Before that
revision, it displayed the 'apisandbox-results-error' message in this
situation.

Apparently the jQuery 3 changes to Deferred behavior caused it to be
impossible to have a then() filter return `this` (or anything else) in
order to avoid replacing the existing promise that's being resolved or
rejected.

Bug: T165857
Change-Id: I3f646cdfe7fe8987437980790788821f51e728d1
resources/src/mediawiki.special/mediawiki.special.apisandbox.js