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
Comments
+1 would love to be able to use this in tests |
see #32 |
+1 on this, I was just about to open a new issue, throwing non errors is wrong, and if you This is for some reason not part of the promises specification, and it's a flaw imho. |
+1 |
👍 Please raise the priority on this. This is not a feature, it's a bug. |
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. |
@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 |
👍 |
Its been a month, can we please have this? |
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.The text was updated successfully, but these errors were encountered: