Mholloway has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/348868 )
Change subject: Recognize SocketTimeoutException as an offline error ...................................................................... Recognize SocketTimeoutException as an offline error Some devices attempt to connect and throw a SocketTimeoutException rather than immediately returning an UnknownHostException. Add this to the list to check in ThrowableUtil.isOffline. Change-Id: I4f4568e8579e271418ec40de1b48ec2ddb589221 --- M app/src/main/java/org/wikipedia/util/ThrowableUtil.java 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/68/348868/1 diff --git a/app/src/main/java/org/wikipedia/util/ThrowableUtil.java b/app/src/main/java/org/wikipedia/util/ThrowableUtil.java index c3ea004..d81e7ee 100644 --- a/app/src/main/java/org/wikipedia/util/ThrowableUtil.java +++ b/app/src/main/java/org/wikipedia/util/ThrowableUtil.java @@ -15,6 +15,7 @@ import org.wikipedia.login.LoginClient; import java.net.SocketException; +import java.net.SocketTimeoutException; import java.net.UnknownHostException; import java.util.concurrent.TimeoutException; @@ -75,7 +76,9 @@ } public static boolean isOffline(@NonNull Throwable caught) { - return caught instanceof UnknownHostException || caught instanceof SocketException; + return caught instanceof UnknownHostException + || caught instanceof SocketException + || caught instanceof SocketTimeoutException; } public static boolean is404(@NonNull Context ctx, @NonNull Throwable caught) { -- To view, visit https://gerrit.wikimedia.org/r/348868 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4f4568e8579e271418ec40de1b48ec2ddb589221 Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Mholloway <mhollo...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits