Skip to content
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

Reject with error #24

Closed
OliverJAsh opened this issue Nov 6, 2014 · 9 comments · Fixed by #345
Closed

Reject with error #24

OliverJAsh opened this issue Nov 6, 2014 · 9 comments · Fixed by #345
Assignees

Comments

@OliverJAsh
Copy link

It is good practice to reject promises with an error object because they have stack traces.

When rejecting because of a bad status code, I suggest rejecting with an error object, e.g. BadStatusCodeError. You could then attach the response object to the error object so it can be accessed in a rejection handler.

@jtmarmon
Copy link

jtmarmon commented Jan 2, 2015

+1 would love to be able to use this in tests

@jtmarmon
Copy link

jtmarmon commented Jan 2, 2015

see #32

@kilianc
Copy link

kilianc commented Dec 22, 2015

+1 on this, I was just about to open a new issue, throwing non errors is wrong, and if you async or yield axios that's exactly what happens.

This is for some reason not part of the promises specification, and it's a flaw imho.

@trueter
Copy link

trueter commented Apr 21, 2016

+1

@helmus
Copy link

helmus commented May 17, 2016

👍 Please raise the priority on this. This is not a feature, it's a bug.

@naw
Copy link

naw commented May 18, 2016

It's possible to address this without breaking backward compatibility simply by making it configurable with a default that uses the current (legacy) behavior. Then, for a major release, you can simply change the default from the legacy behavior to the new behavior.

@kilianc
Copy link

kilianc commented May 18, 2016

@naw this is a bug fix not a feature change. It may make sense to be more conservative and bump minor. I hope the old behavior just goes away

@axross
Copy link

axross commented May 19, 2016

👍

@trueter
Copy link

trueter commented Jul 13, 2016

Its been a month, can we please have this?

@axios axios locked and limited conversation to collaborators May 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants