Comments (8)
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.
Sounds good, I will try it out and see if I can create some documentation/examples for this.
Thanks
from feign.
thanks!
from feign.
Would https://github.com/Netflix/feign/wiki/Custom-error-handling suffice? :)
Or would you rather have all docs in the code repo?
from feign.
Fine by me if the javadocs have a link to it. I think guava uses this
approach for the *Explained wikis.
from feign.
@adriancole Do you have a plan about adding this feature to Feign ?
from feign.
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.
@adriancole Yeah I understand! There are many different ways to process HTTP status codes.
Thanks for your quick reply.
from feign.
Related Issues (20)
- Release notes for 13.0 HOT 2
- RetryableException is ambiguous HOT 2
- URL unsafe characters get decoded before the request is sent
- Potential risk of easily overlooked resource leaks.
- Is It possible to configure connectTimeout and readTimeout options per method request HOT 2
- Capability can't find correct enrich method HOT 5
- [Question] Can I disable pct-encoding for @RequestLine HOT 3
- Feign does not proxy the methods inherited from interface if there are manually added ones
- HC5 client can't send compressed POST requests HOT 1
- Documentation for the metrics reported to micrometer when using MicrometerCapability HOT 5
- Feign.Builder have a requestInterceptor bug HOT 2
- RetryableException should hold the methodKey as well
- Can't set request header in json format HOT 5
- after upgrade version from springboot 3.1.6 to 3.2.0 can not start HOT 1
- Performance discussion about default openfeign client HOT 6
- Noop Hostname Verifier option does not appear to work with Java 21
- Bug:ConcurrentModificationException at feign.SynchronousMethodHandler.targetRequest(SynchronousMethodHandler.java:162)
- Error in RequestTemplate#uri when there're both query and fragment
- Error in Expressions.PathStyleExpression#getValue
- @GetMapping Required String parameter is not present HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from feign.