Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
When an async method is called in a JS client for a server which is down, the call should call a supplied callback.
Actually the async call fails with the following error and the callback not called.
OPTIONS http://xxxx net::ERR_CONNECTION_REFUSED
Note that the above OPTIONS is because I use HTTP OPTIONS. Don't mind.
Thrift.TXHRTransport.flush() has the following fragment.
if (callback) {
//Ignore XHR callbacks until the data arrives, then call the
// client's callback
xreq.onreadystatechange =
(function() {
var clientCallback = callback;
return function() {
if (this.readyState == 4 && this.status == 200)
};
}());
}
I think the reason why the callback is not called is that "this.status == 200" ignores fatal statuses and skips clientCallback().