-
Notifications
You must be signed in to change notification settings - Fork 49
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
ajaxError implementation breaks Ember.js contract #59
Comments
Thanks for the bug report. There's definitely some inconsistency in our implementation and the comment in this adapter. I looked at the active model adapter and it also returns the jqXHR instead of the an Error in this case ( I chose to parse the error that Django Rest Framework provides because I thought it would be more useful than returning the jqHXR. I'm definitely open to changing this but I just want to understand how this is normally used in Ember applications. Can you provide an example of something that you can't do with the current implementation? Or an example that shows the returning the jqXHR is better? Thanks. |
For startes I can't do what guide tells me I should be able to do: Resources on ember.js forums show me that I should be able to do so: I want to look into error within my ApplicationRouter error handler and thus make call between error404 page that will have search field, common links and suggestions about why user can't reach page, and error 403 that will actually display error message from server. There is also special kind of error 403 that happens when user is banned. In this case ban details are added to error JSON and I can notice that within 403 handling and render errror-banned template that will display this JSON. Finally there is also special 0 status code which I would love to redirect to error 0 page explaining user that server connection has been lost. |
Ok, I'll fix this. Thanks for the information. |
👍 good man, thanks for working on this! |
Yep, my Ember.js ApplicationRoute's error hook can now access error status and whole message. There's also |
While Ember-Data ajaxError returns errored jqXHR (as documented), ember-django-adapter instead returns
Error(jsonErrors['detail']);
breaking contract and making any suffisticated error processing impossible due to no original error data with exception of "detail" message making it to application.The text was updated successfully, but these errors were encountered: