Find operation (AJAX request) rejected, not seen in the wire

梦想的初衷 提交于 2019-12-23 16:25:00

问题


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:

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?


回答1:


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);
});

Hope it helps.



来源:https://stackoverflow.com/questions/18395405/find-operation-ajax-request-rejected-not-seen-in-the-wire

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!