Skip to content
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

Report better error when type is missing from a JSONApi response #3946

Merged
merged 1 commit into from Nov 24, 2015
Merged

Report better error when type is missing from a JSONApi response #3946

merged 1 commit into from Nov 24, 2015

Conversation

ghost
Copy link

@ghost ghost commented Nov 20, 2015

Fixes #3945

@@ -465,6 +472,9 @@ const JSONAPISerializer = JSONSerializer.extend({

Ember.runInDebug(function() {
JSONAPISerializer.reopen({
warnMessageForUndefinedType: function() {
return 'Encountered a resource object with an undefined type';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we expand this error message and refer to the current serializer? Using this.constructor.toString() like in warnMessageNoModelForType

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! I have added it to the patch.

bmac added a commit that referenced this pull request Nov 24, 2015
Report better error when `type` is missing from a JSONApi response
@bmac bmac merged commit 845d969 into emberjs:master Nov 24, 2015
@bmac
Copy link
Member

bmac commented Nov 24, 2015

Thanks @martndemus

@ghost ghost deleted the better-error-undefined-type branch November 24, 2015 15:42
@ghost
Copy link
Author

ghost commented Nov 24, 2015

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants