Drop AJAX error detection helpers
See original GitHub issueI feel like the error detection functions that we provide aren’t all that useful. Specifically:
- Functions should generally take one kind of input and return one kind of output. We take either an
AjaxError
instance or a number and try to verify that it’s describing some kind of error. While useful, I think this is kind of confusing behavior. - People really can’t (or shouldn’t) have code where the argument is some variable that could be either an error object or a number; they must know ahead of time whether it’s a number or error object and could just check it directly
- If they are using it with only one argument type in mind, then they should just do a number comparison, or an
instanceof
check, themselves. Preferably the latter, since our descriptive error classes remove the need checking the status code directly.
If we were to remove them in v3.0.0
, then for the time being we would deprecate the error checkers, and then remove them entirely in v3.0.0
.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Ajax - Checking for connection drops - Stack Overflow
First off, you can hook the error handling of the ajax call. If it fails, you should eventually get an error condition back....
Read more >AJAX error handling with jQuery - Wipfli LLP
Looking for tips on AJAX error handling? Being able to handle errors on AJAX calls is a great way to fine-tune your JavaScript....
Read more >Customizable Error Classes #292 - ember-cli/ember-ajax
Our server responses (for errors) contain a bunch of useful metadata, in a specific JSON format. ... Drop AJAX error detection helpers #177....
Read more >Solutions to 5 Common Ajax Problems - Webdesigner Depot
Problem #3: The User Doesn't Know That an Ajax Request Has Completed ... This is related to the previous problem but is often...
Read more >Simple Implementation of MVC Cascading Ajax Drop Down
Here is a simple implementation of MVC cascading Ajax dropdown. ... Drop Down and Select Sub Category to populate Products Drop Down.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve changed my mind on this and would rather just keep them around.
@alexlafroscia Done! https://github.com/ember-cli/ember-ajax/issues/292
I don’t think Ember.Error is reopenable (not in the same way other Ember Objects are, anyway). But yes, reopenable would definitely work.