-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Throw a more helpful error message if the response from queryRecord i… #3864
Conversation
@@ -175,6 +175,7 @@ export function _queryRecord(adapter, store, typeClass, query) { | |||
var record; | |||
store._adapterRun(function() { | |||
var payload = normalizeResponseHelper(serializer, store, typeClass, adapterPayload, null, 'queryRecord'); | |||
Ember.assert('`store.queryRecord` expected the adapter to return one record but the response from the adapter was empty.', payload.data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this assert that payload.data
is an object, not just truthy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
confirm.
Igor and I looked at this again and we released its not clear where in the stack to reject a missing |
Throw a more helpful error message if the response from queryRecord i…
The origial intent was for a queryRecord with no response to reject the promise so it would act like a `findRecord` with a 404. This change introduced a regression that broke existing apps so it is going to be reverted. Closes emberjs#4219
…s empty