Comments (1)
@hellboy81 can you try:
There's one part in the exception generator that I'm not terribly proud of:
private Object resolveBody(Response response) {
if (bodyType instanceof Class<?> && ((Class<?>) bodyType).isInstance(response)) {
return response;
}
try {
return bodyDecoder.decode(response, bodyType);
} catch (IOException e) {
// How do we log this?
return null;
} catch (DecodeException e) {
// How do we log this?
return null;
}
}
you see that it basically tries its best to decode the body, but if it fails, it actually does so silently (yuck).
That said - Feign itself doesn't decide on a logger for you... which begs the question: how to best log?
I expect that ErrorResponse is likely being returned in a format you don't expect or that your POJO doesn't fit to. You can perhaps debug by having the constructor just take feign.Response
and capture the body/decode it yourself just to see what is happening.
The other option is a little more intrusive (Support some form of logging - while still not trying to be opinionated - much like what Feign itself tries to do). If you have a proposal (maybe we include a Logger
class/object that logs the error, and if available, the body or so) then I'll be happy to implement it (or even, if you are up for it, have you implement it and I'll review).
Thoughts?
from feign-annotation-error-decoder.
Related Issues (18)
- initial commit of annotation error decoder HOT 1
- Dont work use global interface HOT 5
- v1.0.3 does not work with feign-core 10.x.x HOT 10
- with move to feign-core 10.x.x, support capturing the request in Exception constructors HOT 6
- Add option to pass methodKey to exception constructor HOT 2
- AnnotationErrorDecoder throws IllegalStateException on validateGeneratorCanBeUsedToGenerateExceptions with null body and complex body decoder
- Use own ExceptionGenerator HOT 4
- [Question] - Annotation based Retry After Exception HOT 5
- ErrorHandlerMap empty if only define annotation class
- [Question] Ignore custom exception constructors at startup
- Gradle dependency HOT 4
- Meta-annotation support HOT 1
- Upgrade to Feign 10.10.x HOT 12
- Upgrade 11.0 HOT 3
- Where can I find an example to use with Spring and @FeignClient
- documentation should be explicit about the custom exception constructor contract HOT 3
- Use with Spring Cloud HOT 7
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-annotation-error-decoder.