Re-classifying NO_NETWORK to be only UnknownHostException on Android (#709)
* Re-classifying NO_NETWORK to be only UnknownHostException At some point recently various socket exceptions started getting classified as "isNoNetworkFailure". While this was intended to be helpful classification, the resulting behavior is that on a socket exception, retry logic will not get engaged. This is because retry logic does not attempt to retry if there is no network in order to save from repeatedly waiting when there isn't a reason to wait. This behavior change was not good or intended so I am reverting it.
This commit is contained in:
Родитель
d81df0a775
Коммит
236c7c8246
|
@ -67,10 +67,10 @@ public class HttpClientRequest {
|
||||||
OK_CLIENT.newCall(this.requestBuilder.build()).enqueue(new Callback() {
|
OK_CLIENT.newCall(this.requestBuilder.build()).enqueue(new Callback() {
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(final Call call, IOException e) {
|
public void onFailure(final Call call, IOException e) {
|
||||||
boolean isNoNetworkFailure =
|
// isNoNetworkFailure indicates to the native code when to assume the client is
|
||||||
e instanceof UnknownHostException ||
|
// disconnected from the internet. In no network cases, retry logic will not be
|
||||||
e instanceof ConnectException ||
|
// activated.
|
||||||
e instanceof SocketTimeoutException;
|
boolean isNoNetworkFailure = e instanceof UnknownHostException;
|
||||||
|
|
||||||
StringWriter sw = new StringWriter();
|
StringWriter sw = new StringWriter();
|
||||||
PrintWriter pw = new PrintWriter(sw);
|
PrintWriter pw = new PrintWriter(sw);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче