GithubHelp home page GithubHelp logo

Comments (7)

mixalturek avatar mixalturek commented on June 20, 2024 1

Hi, any plan for release of the fix?

from redaxios.

developit avatar developit commented on June 20, 2024 1

@andreychev I just published 0.4.1 with this included.

from redaxios.

auburnsummer avatar auburnsummer commented on June 20, 2024

It looks like at line 204-205 it checks for a 4xx/5xx status before parsing the response data, so there won't be response data on error responses.

For me, I just copied the entire index.js into my own project. Then I removed line 205 (if (!ok)...) and changed line 219 to .then(() => ok ? response : Promise.reject(response)). Seemed to work fine.

from redaxios.

developit avatar developit commented on June 20, 2024

Fixed in #56

from redaxios.

orinayo avatar orinayo commented on June 20, 2024

@developit, do you plan on releasing this fix soon?

from redaxios.

andreychev avatar andreychev commented on June 20, 2024

@developit

Any news on this one?

from redaxios.

axmad386 avatar axmad386 commented on June 20, 2024

Hi @developit. I have updated redaxios. Before it, I use axios and this is my error handler example

Axios(...)
 .then(..)
 .catch(err=>{
    if(err.response!== undefined){
    // handle error data here
    console.log(err.response.data)
 })

But in [email protected] i have to refactor the code to this

Axios(...)
 .then(..)
 .catch(err=>{
    if(err.data!== undefined){
    // handle error data here
    console.log(err.data)
 })

Note the difference, err.response.data (axios) vs err.data(redaxios)

from redaxios.

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.