Skip to content

Send Error instances to reject()#36

Open
joeyespo wants to merge 1 commit into
instructure:masterfrom
joeyespo:reject-with-error-instances
Open

Send Error instances to reject()#36
joeyespo wants to merge 1 commit into
instructure:masterfrom
joeyespo:reject-with-error-instances

Conversation

@joeyespo

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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

Copy link
Copy Markdown
Author

@stefanpenner Excellent. Thanks for replying!

@Kerrick

Kerrick commented Nov 17, 2017

Copy link
Copy Markdown

@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

CLAassistant commented Oct 3, 2019

Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants