PDA

View Full Version : [INFOREQ] Ext.Ajax.request failure function doesn't get invoked while server is offline



BIS
21 May 2012, 1:14 AM
REQUIRED INFORMATION
Ext version tested:

Sencha touch 2.0.0
Browser versions tested against:

Android 2.1 browser! (no idea what that is)
Google Chrome
DOCTYPE tested against:

<DOCTYPE html>
Description:

Ext.Ajax.request failure function doesn't get invoked while server is offline.


As the the docs state, and as in Ext2,3,4 has been doing, Ext.Ajax.request failure function should be called on network errors (i.e. server turns offline)I used this syntax to call the server

Ext.Ajax.request({
?url:'mypage.php'
, success : console.log
, failure : function(){
console.log('fail', arguments);
}
});

Steps to reproduce the problem:

load the page
shut down the server
invoke ajax request (works fine when online, i.e. a b)
The result that was expected:

failure function to be called resulting in a console like:
fail Object Object
The result that occurs instead:

a call to the success function, with success argument of "false", and a console log like:
Object Object
Debugging already done:

attaching listeners on the Ext Ajax "requestexception" event, non called
Possible fix:

using the success handler "response.success" argument

mitchellsimoens
21 May 2012, 5:20 AM
Do you get a 404 error then?

BIS
21 May 2012, 10:36 AM
Do you get a 404 error then?

I've turned off the web server completely, so I should get a 404, however chrome console and ff firebug are giving me "failed" and "aborted" respectively and no response body or headers are present in firebug of chrome console for me to tell exactly

thanks for the help in advance