Skip to content

App crashes on 500 error #33

Open
Open
@hafeez1042

Description

@hafeez1042

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

Activity

real-ashwin

real-ashwin commented on Mar 23, 2016

@real-ashwin

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

szahn commented on Mar 31, 2016

@szahn

+1

real-ashwin

real-ashwin commented on Mar 31, 2016

@real-ashwin

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

rkatic commented on Jul 29, 2016

@rkatic

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.

added a commit that references this issue on Jul 29, 2016
2af37ff
added a commit that references this issue on Jul 31, 2016
rkatic

rkatic commented on Jul 31, 2016

@rkatic

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @rkatic@szahn@real-ashwin@hafeez1042

        Issue actions

          App crashes on 500 error · Issue #33 · redux-utilities/redux-promise