我正在使用 ExtJS 4.1,当发生超时时,我在 Google Chrome 中遇到了一个未捕获的异常。
Ext.Ajax.timeout = 10000; // 10 seconds
Ext.Ajax.method = "GET";
Ext.Ajax.request({
url:'rest/dataloggerset.json',
params:{
sessionGuid:Ext.getStore("User").getAt(0).get("sessionGuid"),
loggerId:this.availableLogFiles.loggerId,
logSet:this.currentLog
},
success:this.processReceivedLogData,
failure:this.failureDuringResourceLoad,
scope:this
});
请求以超时结束,并且尝试在对象中解析到目前为止接收到的数据。因此,我在开发人员控制台中看到的未捕获异常如下所示:
未捕获的错误:INVALID_STATE_ERR:DOM 异常 11 Connection.js:914 Ext.define.createResponse Connection.js:914 Ext.define.onComplete Connection.js:859 Ext.define.abort Connection.js:767 request.timeout
这个问题在FF中没有出现。由于未捕获的异常,我的方法 failureDuringResourceLoad 没有被调用。
值得一提的是,当定义的超时时间过去时,数据仍在传输。
有任何想法吗?