From ed6a0f8cd0d4cb218d609b5957db38844fda16ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Borcz?= Date: Fri, 7 Jun 2019 21:38:53 +0200 Subject: [PATCH] Add StackOverflowError to RxJava's error handler (#408) --- app/src/main/java/io/github/wulkanowy/WulkanowyApp.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/github/wulkanowy/WulkanowyApp.kt b/app/src/main/java/io/github/wulkanowy/WulkanowyApp.kt index 8e972c80..85070edc 100644 --- a/app/src/main/java/io/github/wulkanowy/WulkanowyApp.kt +++ b/app/src/main/java/io/github/wulkanowy/WulkanowyApp.kt @@ -66,8 +66,10 @@ class WulkanowyApp : DaggerApplication() { } private fun onError(error: Throwable) { - if (error is UndeliverableException && error.cause is IOException || error.cause is InterruptedException) { - Timber.e(error.cause, "An undeliverable error occurred") + //RxJava's too deep stack traces may cause SOE on older android devices + val cause = error.cause + if (error is UndeliverableException && cause is IOException || cause is InterruptedException || cause is StackOverflowError) { + Timber.e(cause, "An undeliverable error occurred") } else throw error }