-
-
Notifications
You must be signed in to change notification settings - Fork 141
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
Type-Error thrown when a JSON-API server responds with a 406 error and an error body #552
Comments
@psbanka 👋 I merged a PR that included improvements to an existing test to more closely match your case. However, I'm still seeing the tests pass. Do you happen to know how your situation might not be reflected in the tests? Feel free to reopen the issue if you feel the need to! |
I'm running into this as well. Is there a way to work around this? |
Some data I've gathered:
{"errors":{"user_email":["digit@example.com is already a client"]}}
{ userEmail: null, firstName: null, lastName: null, email: null }
because
|
I'm running into this too and thank the gods I'm not alone in this, because I've been scratching my head for hours on this one and have not figured out a workaround yet. @snewcomer Might want to reopen this one |
@jherdman For 6), if Do you happen to know of a good test we could add? |
Merge-deep in https://github.com/poteto/ember-changeset/blob/master/addon/utils/merge-deep.js#L75 Yesterday when stepping through my code (which is using ember-changeset 3.10.1), I was hitting that spot in https://github.com/validated-changeset/validated-changeset/blob/master/src/utils/merge-deep.ts#L71 Going up a level and starting at the |
Published 3.10.2. Hopefully this resolves the |
Works for me! Thanks @snewcomer |
Version
3.9.2
Test Case
Sorry, don't have a test case for this
Steps to reproduce
When saving a changeset, have a server respond with a 406 error response and the following body:
Expected Behavior
I expect the Ember Data exception to be passed to my
catch()
rather than a type-error from ember-changesetActual Behavior
ember-changeset throws a
TypeError
:TypeError: Cannot convert undefined or null to object
, and it is impossible to get the original error back from Ember Data. Instead, I have to pull all the information out of thechangeset.snapshot().changes
object, save them to the model manually, and save the model in order to get the Ember Data exception.The text was updated successfully, but these errors were encountered: