diff options
author | H. Lehmann <ByteHamster@users.noreply.github.com> | 2019-09-03 19:14:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-03 19:14:17 +0200 |
commit | 0ae092be3af1b42720c952c3de5571cf1e60a204 (patch) | |
tree | 7b8ed018cde9243e341b819b06b5e619004b2f90 /core/src/main/java | |
parent | 87a1f5c2f4afea83d685475946bd381763bc74a6 (diff) | |
parent | 7cc5f86979c9345a67670745374fdd0deca4613d (diff) | |
download | AntennaPod-0ae092be3af1b42720c952c3de5571cf1e60a204.zip |
Merge pull request #3366 from ByteHamster/add-feed-improvements
Add feed improvements
Diffstat (limited to 'core/src/main/java')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/util/exception/RxJavaErrorHandlerSetup.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/exception/RxJavaErrorHandlerSetup.java b/core/src/main/java/de/danoeh/antennapod/core/util/exception/RxJavaErrorHandlerSetup.java index f34ca75be..12f0c1c6e 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/exception/RxJavaErrorHandlerSetup.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/exception/RxJavaErrorHandlerSetup.java @@ -1,6 +1,7 @@ package de.danoeh.antennapod.core.util.exception; import android.util.Log; +import de.danoeh.antennapod.core.gpoddernet.GpodnetServiceException; import io.reactivex.exceptions.UndeliverableException; import io.reactivex.plugins.RxJavaPlugins; @@ -13,16 +14,21 @@ public class RxJavaErrorHandlerSetup { } public static void setupRxJavaErrorHandler() { - RxJavaPlugins.setErrorHandler(e -> { + RxJavaPlugins.setErrorHandler(originalCause -> { + Throwable e = originalCause; if (e instanceof UndeliverableException) { e = e.getCause(); } + if (e instanceof GpodnetServiceException) { + e = e.getCause(); + } if (e instanceof InterruptedException || e instanceof InterruptedIOException) { // fine, some blocking code was interrupted by a dispose call - Log.d("RxJavaErrorHandler", "Ignored exception: " + Log.getStackTraceString(e)); + Log.d("RxJavaErrorHandler", "Ignored exception: " + Log.getStackTraceString(originalCause)); return; } - Thread.currentThread().getUncaughtExceptionHandler().uncaughtException(Thread.currentThread(), e); + Thread.currentThread().getUncaughtExceptionHandler() + .uncaughtException(Thread.currentThread(), originalCause); }); } } |