instructure / ic-ajax

ember-friendly jQuery.ajax wrapper
MIT License
167 stars 29 forks source link

Send Error instances to reject() #36

Open joeyespo opened 9 years ago

joeyespo commented 9 years ago

Thanks for ic-ajax!

One small problem though. My company is also using a library that catches and reports unhandled RSVP errors, and I kept getting an [object Object] as a message with no other context information. We were able to track it down to ic-ajax sending an object to reject() instead of the recommended Error instance (here and here). This is reasonable because it helps debugging efforts and also because in practice, a lot of tools have come to expect this.

The fix aims to be minimally invasive by still providing jqXHR, textStatus, and errorThrown so existing code doesn't break, while still replacing a generic object with an Error instance.

stefanpenner commented 9 years ago

cc @tchak

I think we are planning to deprecate this, and move to a fetch polyfil. Short term, we may take an intermediate step.

joeyespo commented 9 years ago

@stefanpenner Excellent. Thanks for replying!

Kerrick commented 6 years ago

@stefanpenner Did this library ever get deprecated? Did we ever move to a fetch polyfill? Just curious how the state of things is in 2017.

CLAassistant commented 5 years ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.