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)
This commit is contained in:
MM20 2022-01-09 01:19:25 +01:00
parent ef01439ded
commit 9eecd3513f
No known key found for this signature in database
GPG Key ID: 0B61A8F2DEAFA389
2 changed files with 7 additions and 3 deletions

View File

@ -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)

View File

@ -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()
}
}