-
Notifications
You must be signed in to change notification settings - Fork 195
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
Not handling Failure FSAs (?) #33
Comments
@bd In your code you don't specify what |
This middleware is not handling 'FAILURE' for me either. Code:
Any ideas? How did you solve this @bd, or what did you start using instead? |
Dont you mean you get the |
There's indeed an error flag. Issuing the 'FAILURE' FSA would make sense, since something surely failed. Thanks very much! |
Good. And it turns out that the issue i linked to was actually about dropping the |
Most likely I'm misinterpreting the docs, but here's my problem:
I would like to handle failed api requests in a similar way to how I handle the successful api requests. Yet as far as I can tell, the
SEARCH_FAILURE
FSA never gets handled, though it is treated (AFAICT) identically to theSEARCH_SUCCESS
FSA. It does seem to be created and dispatched, based on what I see in the devtools.I have this
the
SEARCH_SUCCESS
FSA gets handled bysearchReducer
, but when the server gives a 400 response, theSEARCH_FAILURE
handler never gets called--at least I don't see the log output I would expect, and the state sure doesn't end up looking right. I do see aSEARCH_FAILURE
entry in the redux devtools panel, however.Serving to confuse me further, here is the declaration I have at the moment for creating the RSAA
the
payload
function is being called and logging more or less what I'd expect. So what am I messing up here? As far as I can discern from multiple readings of the docs for redux-api-middleware, this setup should yield the behavior I want, but it does not. The successes succeed, but the failures fail...And I'm posting here because it seems like this is either a problem with in the middleware code, or ultimately caused by confusing/sparse language in the docs. I'm happy to post it to stackoverflow or whereever would be more appropriate if this is the wrong area.
The text was updated successfully, but these errors were encountered: