Code Monkey home page Code Monkey logo

Comments (6)

aris-b avatar aris-b commented on May 19, 2024 1

I am also confused. When I get an API request error like this :

{ 
 [RequestError: request to https://xxxxx failed, reason: self signed certificate]
 name: 'RequestError',
 message: 'request to https://xxxx failed, reason: self signed certificate' },
 meta: undefined,
 error: true }

The FAILURE FSA is not triggered. I see this error by logging on REQUEST FSA.
So my question is, when actually FAILURE FSA gets triggered ?

from redux-api-middleware.

agraboso avatar agraboso commented on May 19, 2024

@barrystaes This is an issue that I struggled with — see this comment of mine. The solution that I came up with might not be to everyone's taste nor even the most logical one. I think a thorough discussion is in order before we push out a v2.

from redux-api-middleware.

agraboso avatar agraboso commented on May 19, 2024

Pinging #26, since it is relevant to this issue.

from redux-api-middleware.

danludwig avatar danludwig commented on May 19, 2024

Found this when searching for how to customize the action payload when a REQUEST FSA is dispatched with an error flag. Seems you can't? For example, if I attach a key property to the initial REQUEST payload, there is no way to correlate that key's value back to the request that failed?

from redux-api-middleware.

barrystaes avatar barrystaes commented on May 19, 2024

So my question is, when actually FAILURE FSA gets triggered ?

@aris-b a FAILURE FSA is triggered when the response is not 200 OK, and if the response was 200 OK expect a SUCCESS FSA.
If the request could not be made at all, expect a REQUEST FSA with error:true. This behavior is documented at lifecycle in readme.md and its also outlined in the first post of this issue..

@danludwig Have you looked into using the meta property, which is there for the purpose of adding metadata to use later.

from redux-api-middleware.

iamandrewluca avatar iamandrewluca commented on May 19, 2024

Fixed in #175

from redux-api-middleware.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.