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

Confusing error message inside record-data.ts #7343

Closed
igorT opened this issue Sep 29, 2020 · 1 comment · Fixed by #8344
Closed

Confusing error message inside record-data.ts #7343

igorT opened this issue Sep 29, 2020 · 1 comment · Fixed by #8344
Labels
good-first-issue 🏷️ feat This PR introduces a new feature

Comments

@igorT
Copy link
Member

igorT commented Sep 29, 2020

Passing improper payloads sometimes results in error messages that look like:

Assertion Failed: Encountered a relationship identifier without a type for the hasMany relationship 'zones' on <scheme:8e11d4ae-e361-43df-8fc3-d0f44a638937>, expected a json-api identifier with type 'zone' but found {big object definition}

This has at least two issues:

  1. It refers to json-api, even though it's inside record-data and the user could be using a different serializer
  2. The object dump is not useful
@runspired
Copy link
Contributor

The object dump should stringify nicely, that it's not is definitely a bug (we set it up for them to stringify nicely in DEBUG but not prod).

Referring to JSON:API is intentional as by this point the format must be JSON:API. It doesn't matter what serializer base class you've extended. Hiding this from the end-user only creates unneeded confusion about how serializers work, which is why the newer API docs attempt to make it very clear that normalized data must be JSON:API. https://api.emberjs.com/ember-data/release/modules/@ember-data%2Fserializer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good-first-issue 🏷️ feat This PR introduces a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants