测试
X
import feign.Response;
import feign.RetryableException;
import feign.codec.ErrorDecoder;
public class CustomErrorDecoder implements ErrorDecoder {
@Override
public Exception decode(String methodKey, Response response) {
if (response.status() == 429) {
return new RetryableException(
"Too many requests",
null,
response.request().httpMethod(),
null,
response.request());
}
return new RuntimeException("Unknown error");
}
}
浙公网安备 33010602011771号