From 9eecd3513fe1a893a6663d14d023d7279faade35 Mon Sep 17 00:00:00 2001 From: MM20 <15646950+MM2-0@users.noreply.github.com> Date: Sun, 9 Jan 2022 01:19:25 +0100 Subject: [PATCH] Don't log CancellationException to crash reporter They are usually not a problem and can occur naturally (e.g. if a search is cancelled because the search query has changed) --- crashreporter/build.gradle.kts | 2 +- .../java/de/mm20/launcher2/crashreporter/CrashReporter.kt | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/crashreporter/build.gradle.kts b/crashreporter/build.gradle.kts index 4997b4c6..52bb5c50 100644 --- a/crashreporter/build.gradle.kts +++ b/crashreporter/build.gradle.kts @@ -35,7 +35,7 @@ android { } dependencies { - implementation(libs.kotlin.stdlib) + implementation(libs.bundles.kotlin) implementation(libs.androidx.appcompat) implementation(libs.materialcomponents.core) implementation(libs.androidx.recyclerview) diff --git a/crashreporter/src/main/java/de/mm20/launcher2/crashreporter/CrashReporter.kt b/crashreporter/src/main/java/de/mm20/launcher2/crashreporter/CrashReporter.kt index 9ccaf905..611e8609 100644 --- a/crashreporter/src/main/java/de/mm20/launcher2/crashreporter/CrashReporter.kt +++ b/crashreporter/src/main/java/de/mm20/launcher2/crashreporter/CrashReporter.kt @@ -2,13 +2,17 @@ package de.mm20.launcher2.crashreporter import android.content.Intent import android.util.Log +import kotlinx.coroutines.CancellationException object CrashReporter { fun logException(e: Exception) { - com.balsikandar.crashreporter.CrashReporter.logException(e) + if (e !is CancellationException) { + com.balsikandar.crashreporter.CrashReporter.logException(e) + } Log.e("MM20", Log.getStackTraceString(e)) } - fun getLaunchIntent() : Intent { + + fun getLaunchIntent(): Intent { return com.balsikandar.crashreporter.CrashReporter.getLaunchIntent() } } \ No newline at end of file