amplitude/redux-query

Reject promise on request failure

Closed this issue · 1 comments

Why we not call reject when request get the error from the server?

https://github.com/amplitude/redux-query/blob/master/src/middleware/query-advanced.js#L95

It was an intentional decision I made a long time ago. It was mostly because promise rejections can be tricky to deal with sometimes. And like the fetch, you can always write your own .then() function to create this behavior if you'd like. For example: https://developers.google.com/web/updates/2015/03/introduction-to-fetch#chaining_promises