do not reject promise on request returning error status #2934
Hugo-Trentesaux
started this conversation in
Ideas
Replies: 2 comments
-
What if the error response is a JSON payload (as it usually is)? |
Beta Was this translation helpful? Give feedback.
0 replies
-
If it's valid and no error is raised, it goes through the extract function and then the resolution function. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
The current behaviour of the promise is the following :
This behaviour seems counter-intuitive. I think it should be changed.
I did a pull request to do what I thought would be the more obvious, but @isiahmeadows told me the reason it was like this : implemented in #2006 to comply with #2000
Because these reasons seems reasonable, I think we should align the behaviour of the function when no extract function is provided. That means:
Implementation
https://github.com/MithrilJS/mithril.js/blob/master/request/request.js#L115-L138
Beta Was this translation helpful? Give feedback.
All reactions