Improve handling of SSLExceptions.
Current theory is that some Samsung devices a doing something funky with SSLExceptions, causing them to not be caught as IOExceptions.
This commit is contained in:
parent
e67ac95890
commit
533dcfb828
1 changed files with 14 additions and 0 deletions
|
@ -7,6 +7,10 @@ import org.signal.core.util.logging.Log;
|
||||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import javax.net.ssl.SSLException;
|
||||||
|
|
||||||
import io.reactivex.rxjava3.exceptions.OnErrorNotImplementedException;
|
import io.reactivex.rxjava3.exceptions.OnErrorNotImplementedException;
|
||||||
|
|
||||||
public class SignalUncaughtExceptionHandler implements Thread.UncaughtExceptionHandler {
|
public class SignalUncaughtExceptionHandler implements Thread.UncaughtExceptionHandler {
|
||||||
|
@ -21,6 +25,16 @@ public class SignalUncaughtExceptionHandler implements Thread.UncaughtExceptionH
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void uncaughtException(@NonNull Thread t, @NonNull Throwable e) {
|
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) {
|
if (e instanceof OnErrorNotImplementedException && e.getCause() != null) {
|
||||||
e = e.getCause();
|
e = e.getCause();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue