查找操作(AJAX请求)被拒绝,没有在线中看到 [英] Find operation (AJAX request) rejected, not seen in the wire
问题描述
在我的应用程序中,我正在执行几个查找
操作。他们都在工作,除了一个,正在被拒绝。为了调试目的,我在应用程序启动期间发送请求:
In my application, I am doing several find
operations. All of them are working, except one, which is being rejected. For debugging purposes, I am sending the requests during startup of the application:
preloadData : function () {
SettingsApp.Node.find();
SettingsApp.Locator.find();
SettingsApp.Phonelocation.find();
SettingsApp.User.find(CNST.ME_FAKE_DOC_ID);
SettingsApp.Company.find(CNST.MY_ORG_FAKE_DOC_ID);
},
这是它在控制台中的外观:
And this is how it looks in the console:
如你所见,所有请求都是 isFullfilled
,除了最后一个 isRejected
之外。 rejectedReason
只说错误。
As you can see, all requests are isFullfilled
except the last one which is isRejected
. The rejectedReason
says only "error".
可能是什么原因?这不是后端问题,因为请求没有被发送。唯一可以想到的是适配器配置,因为公司
有不规则的复数:
What could be causing this? This is no backend problem, since the request is not being sent at all. The only thing I can think of is the adapter configuration, since companies
has an irregular plural:
SettingsApp.Adapter.configure('plurals', {
voice_menu : 'voicemenus',
profile : 'profile',
company : 'companies',
});
但是这样做正在被正确使用。还有什么可能导致这种情况?
But this is being used properly, it seems. What could else be causing this?
推荐答案
我不知道你的 GET
请求被拒绝,但作为调试目的的快速解决方法,您可以执行以下操作以获取有关发生的错误的更多信息:
I don't know the exact reason why your GET
request is rejected, but as a quick workaround for debugging purposes you could do the following to get more info on the errors that are occurring:
Ember.RSVP.configure('onerror', function(error) {
console.log(error.message);
console.log(error.stack);
});
希望有帮助。
这篇关于查找操作(AJAX请求)被拒绝,没有在线中看到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!