Skip to content

Commit 5e912dd

Browse files
author
Oriental Sensation
committed
Let the user add further exception classes to RetryHandler's whitelist/blacklist.
1 parent 9b6e509 commit 5e912dd

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

library/src/main/java/com/loopj/android/http/AsyncHttpClient.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -187,18 +187,6 @@ private static SchemeRegistry getDefaultSchemeRegistry(boolean fixNoHttpResponse
187187
return schemeRegistry;
188188
}
189189

190-
public static void allowRetryExceptionClass(Class<?> cls) {
191-
if (cls != null) {
192-
RetryHandler.addToWhitelist(cls);
193-
}
194-
}
195-
196-
public static void blockRetryExceptionClass(Class<?> cls) {
197-
if (cls != null) {
198-
RetryHandler.addToBlacklist(cls);
199-
}
200-
}
201-
202190
/**
203191
* Creates a new AsyncHttpClient.
204192
*
@@ -262,6 +250,18 @@ public void process(HttpResponse response, HttpContext context) {
262250
httpClient.setHttpRequestRetryHandler(new RetryHandler(DEFAULT_MAX_RETRIES, DEFAULT_RETRY_SLEEP_TIME_MILLIS));
263251
}
264252

253+
public static void allowRetryExceptionClass(Class<?> cls) {
254+
if (cls != null) {
255+
RetryHandler.addClassToWhitelist(cls);
256+
}
257+
}
258+
259+
public static void blockRetryExceptionClass(Class<?> cls) {
260+
if (cls != null) {
261+
RetryHandler.addClassToBlacklist(cls);
262+
}
263+
}
264+
265265
/**
266266
* Get the underlying HttpClient instance. This is useful for setting additional fine-grained
267267
* settings for requests by accessing the client's ConnectionManager, HttpParams and

0 commit comments

Comments
 (0)