Giter VIP home page Giter VIP logo

Comments (5)

luizvarela avatar luizvarela commented on July 21, 2024

We can create a new strategy to handle the API errors, not only 404, but 422 or 401 or other HTTP errors.
as this is a JSON API we don't need to return html responses but just json response, something like this:

{  
   errors:{  
      resource:[  
         "Some explanation about the error"
      ]
   },
   data:{ 
   }
}

I can think how to handle this.

from disease-info.

AfolabiOlaoluwa avatar AfolabiOlaoluwa commented on July 21, 2024

Surely it will not be for only 404. I was thinking with @sunday to redirect to the HTML public document provided. But with this comment I agree we should do away with HTML. I will deal with it using rescue_from and simplify it to handle other errors as well.

from disease-info.

AfolabiOlaoluwa avatar AfolabiOlaoluwa commented on July 21, 2024

@luizvarela @SundayAdefila @osioke I have added root route in this commit.

from disease-info.

AfolabiOlaoluwa avatar AfolabiOlaoluwa commented on July 21, 2024

@SundayAdefila @luizvarela Solved. This is what I came up with here also Route/diseases to root in this commit. However @luizvarela I beg of you to write test for this PR after merged.

from disease-info.

x6iae avatar x6iae commented on July 21, 2024

Fixed with #58

from disease-info.

Related Issues (16)

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.