-
-
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
handleResponse should use serializer to extract errors from payload #4934
Comments
@janmisek does it not work for you to implement extractErrors? |
No it does not, because error response from our backend looks like this:
But adapter expects to have errors in As ember-data should be backend agnostic I would expect to have errors key customizable. Only solution I found is to override handleResponse. But I consider it dirty as parsing of payload should be by my opinion serializer responsibility. My workaround using handleResponse of adapter:
|
I can try to prepare pr ? |
@pangratz seems odd to have that hook on the adapter. Everywhere else the serializer is what understands the payload format, and the adapter is concerned primarily with how to interact with the server, treating the payload as opaque. |
Closing in favor of emberjs/rfcs#860 |
Our backend returns errors in
payload._errors
key, but REST and JSONAPI adapter expects errors inerror
key. To override the behaviourRESTAdapter.handleResponse
must be overriden. But extraction of errors from payload should be serializer responsibilityThe text was updated successfully, but these errors were encountered: