Handle web socket closed unexpectedly errors more gracefully.
This commit is contained in:
parent
49e57a3c66
commit
e6c5080a07
2 changed files with 4 additions and 1 deletions
|
@ -362,6 +362,8 @@ public class ApplicationContext extends Application implements AppForegroundObse
|
|||
return;
|
||||
}
|
||||
|
||||
Log.e(TAG, "RxJava error handler invoked", e);
|
||||
|
||||
Thread.UncaughtExceptionHandler uncaughtExceptionHandler = Thread.currentThread().getUncaughtExceptionHandler();
|
||||
if (uncaughtExceptionHandler == null) {
|
||||
uncaughtExceptionHandler = Thread.getDefaultUncaughtExceptionHandler();
|
||||
|
|
|
@ -16,6 +16,7 @@ import org.whispersystems.signalservice.internal.util.BlacklistingTrustManager;
|
|||
import org.whispersystems.signalservice.internal.util.Util;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.SocketException;
|
||||
import java.security.KeyManagementException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.SecureRandom;
|
||||
|
@ -353,7 +354,7 @@ public class OkHttpWebSocketConnection extends WebSocketListener implements WebS
|
|||
|
||||
while (iterator.hasNext()) {
|
||||
Map.Entry<Long, OutgoingRequest> entry = iterator.next();
|
||||
entry.getValue().onError(new IOException("Closed unexpectedly"));
|
||||
entry.getValue().onError(new SocketException("Closed unexpectedly"));
|
||||
iterator.remove();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue