redux-utilities / redux-promise

FSA-compliant promise middleware for Redux.
MIT License
2.67k stars 134 forks source link

App crashes on 500 error #33

Open hafeez1042 opened 8 years ago

hafeez1042 commented 8 years ago

App is crashing If API call returns with 500, And its working perfectly with redux-promise-middleware

real-ashwin commented 8 years ago

I see this too. App crashes on all errors. The crash happens a few seconds after the API returns during which time the browserTab is not responding. Do we have to explicitly handle promise rejection?

szahn commented 8 years ago

+1

real-ashwin commented 8 years ago

In my case the issue was that I was using jQuery to make the ajax calls. jQuery's deferred is not equal to es6 Promise. Fixed it by replacing redux-promise with redux-deferred.

rkatic commented 7 years ago

Did't try to reproduce, but I'm quite sure the reason this happens, is that error in jQuery.ajax is the jqXHR itself, which itself is a rejected PROMISE, for which this middleware will make dispatch recursively run until stack overflow.

A solution to escape the recursion, is to next(action) if action.error.

rkatic commented 7 years ago

Ok, I found some time to test it and added some tests.