question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Drop AJAX error detection helpers

See original GitHub issue

I 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:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
alexlafrosciacommented, Jun 18, 2018

I’ve changed my mind on this and would rather just keep them around.

0reactions
sandstromcommented, May 2, 2017

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found