[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Recognize SocketTimeoutException as an offline error

2017-04-20 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
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(-)

Approvals:
  Niedzielski: Looks good to me, approved
  jenkins-bot: Verified



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: merged
Gerrit-Change-Id: I4f4568e8579e271418ec40de1b48ec2ddb589221
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Mholloway 
Gerrit-Reviewer: Brion VIBBER 
Gerrit-Reviewer: Dbrant 
Gerrit-Reviewer: Niedzielski 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Recognize SocketTimeoutException as an offline error

2017-04-18 Thread Mholloway (Code Review)
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 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits