I have a REST controller which triggers downstream REST calls through Feign clients. When any kind of error (bad reply, timeout etc.) happens in the downstream, I would like to know the reason and generate REST reply with error data, as show below:
client --> my /auth @RestController
|
| --- downstream Feign client REST call to check auth --> |
|
| <--------------- faulty reply or time out --------------|
<-- graceful error reply--|
What would be the best way to setup Feign Client and its calling code to receive Hystrix / Feign error state in order to produce "graceful error reply"?
I use Spring Boot 2.