问题
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