diff --git a/app/src/main/java/org/thoughtcrime/securesms/util/SignalUncaughtExceptionHandler.java b/app/src/main/java/org/thoughtcrime/securesms/util/SignalUncaughtExceptionHandler.java index c38819e280..986b6ab2cf 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/util/SignalUncaughtExceptionHandler.java +++ b/app/src/main/java/org/thoughtcrime/securesms/util/SignalUncaughtExceptionHandler.java @@ -7,6 +7,10 @@ import org.signal.core.util.logging.Log; import org.thoughtcrime.securesms.dependencies.ApplicationDependencies; import org.thoughtcrime.securesms.keyvalue.SignalStore; +import java.io.IOException; + +import javax.net.ssl.SSLException; + import io.reactivex.rxjava3.exceptions.OnErrorNotImplementedException; public class SignalUncaughtExceptionHandler implements Thread.UncaughtExceptionHandler { @@ -21,6 +25,16 @@ public class SignalUncaughtExceptionHandler implements Thread.UncaughtExceptionH @Override public void uncaughtException(@NonNull Thread t, @NonNull Throwable e) { + // Seeing weird situations where SSLExceptions aren't being caught as IOExceptions + if (e instanceof SSLException) { + if (e instanceof IOException) { + Log.w(TAG, "Uncaught SSLException! It *is* an IOException!", e); + } else { + Log.w(TAG, "Uncaught SSLException! It is *not* an IOException!", e); + } + return; + } + if (e instanceof OnErrorNotImplementedException && e.getCause() != null) { e = e.getCause(); }