Giter Club home page Giter Club logo

Comments (8)

davidmc24 avatar davidmc24 commented on May 14, 2024

I believe the specific error code is already available in the exception via the response object.

The current approach to more specific exceptions is for the user to configure a ErrorDecoder which allows you to massage an exception into a application-specific one. You can have these be generic (such as your proposed 4xx vs 5xx exceptions), or very specific to the particular business use case, as you see fit.

from feign.

pvdissel avatar pvdissel commented on May 14, 2024

Sounds good, I will try it out and see if I can create some documentation/examples for this.

Thanks

from feign.

codefromthecrypt avatar codefromthecrypt commented on May 14, 2024

thanks!

from feign.

pvdissel avatar pvdissel commented on May 14, 2024

Would https://github.com/Netflix/feign/wiki/Custom-error-handling suffice? :)
Or would you rather have all docs in the code repo?

from feign.

codefromthecrypt avatar codefromthecrypt commented on May 14, 2024

Fine by me if the javadocs have a link to it. I think guava uses this
approach for the *Explained wikis.

from feign.

gimbimloki avatar gimbimloki commented on May 14, 2024

@adriancole Do you have a plan about adding this feature to Feign ?

from feign.

codefromthecrypt avatar codefromthecrypt commented on May 14, 2024

I like the wiki/documentation approach. Users will have a better set of ranges that make sense to them.

I don't want to create http code range exceptions, particularly as in many cases this is nuanced and you'll need the underlying code anyway. Ex. 3xx range includes cache-related codes as well redirects. Also, many apis that feign restfulness use 500 for everything or tunnel errors through 200. In other words, we should allow folks to define application-specific exceptions.. absolutely, but I don't think that a shared set of ranged exceptions are high enough value to add to the codebase, knowing what we know.

from feign.

gimbimloki avatar gimbimloki commented on May 14, 2024

@adriancole Yeah I understand! There are many different ways to process HTTP status codes.
Thanks for your quick reply.

from feign.

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.