Reputation: 413
I have this EXT JS code:
Ext.Ajax.request({
url : "xxx",
method : "POST",
params : params,
success : function(response) {
success();
},
failure : function(){
fail();
}
});
The url xxx
returns this piece of JSON.
{"success": false }
For some reason this never goes into failure. It never runs the fail()
method, always success()
. What's going wrong?
Upvotes: 4
Views: 3362
Reputation: 17850
It would call failure handler only when request would failed on the network level - if you get server error or server won't return anything. Otherwise it will be success and you need to parse response to see if it was logical failure.
Upvotes: 5