Skip to content

Commit d0af8f6

Browse files
GH-249 leveraging the retry-after header support of Feign in our IOErrorDecoder (#251)
## Related Issue * GH-249
1 parent 8eabca5 commit d0af8f6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

core/src/main/java/com/adobe/aio/util/feign/IOErrorDecoder.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,22 @@
2020
import org.slf4j.Logger;
2121
import org.slf4j.LoggerFactory;
2222

23-
public class IOErrorDecoder implements ErrorDecoder {
23+
public class IOErrorDecoder extends ErrorDecoder.Default implements ErrorDecoder {
2424

2525
public static final String REQUEST_ID = "x-request-id";
2626

2727
private final Logger logger = LoggerFactory.getLogger(this.getClass());
2828

29+
public IOErrorDecoder() {
30+
super();
31+
}
32+
2933
@Override
3034
public Exception decode(String methodKey, Response response) {
3135
FeignException exception = FeignException.errorStatus(methodKey, response);
3236
logger.warn("Upstream response error ({},{})", response.status(), exception.contentUTF8());
3337
return (response.status() >= 500) ?
34-
new IOUpstreamError(response, exception, getRequestId(response.headers())) : exception;
38+
new IOUpstreamError(response, exception, getRequestId(response.headers())) : super.decode(methodKey, response);
3539
}
3640

3741
private String getRequestId(Map<String, Collection<String>> headers) {

0 commit comments

Comments
 (0)