mirror of
https://github.com/d4rken-org/capod.git
synced 2026-09-14 18:26:11 -04:00
Don't report cancellation exceptions.
This commit is contained in:
@@ -21,6 +21,7 @@ import eu.darken.capod.main.core.PermissionTool
|
||||
import eu.darken.capod.monitor.core.*
|
||||
import eu.darken.capod.monitor.ui.MonitorNotifications
|
||||
import eu.darken.capod.reaction.ReactionHub
|
||||
import kotlinx.coroutines.CancellationException
|
||||
import kotlinx.coroutines.cancel
|
||||
import kotlinx.coroutines.cancelChildren
|
||||
import kotlinx.coroutines.delay
|
||||
@@ -68,9 +69,13 @@ class MonitorWorker @AssistedInject constructor(
|
||||
|
||||
Result.success(inputData)
|
||||
} catch (e: Throwable) {
|
||||
Bugs.report(tag = TAG, "Execution failed", exception = e)
|
||||
finishedWithError = true
|
||||
Result.failure(inputData)
|
||||
if (e !is CancellationException) {
|
||||
Bugs.report(tag = TAG, "Execution failed", exception = e)
|
||||
finishedWithError = true
|
||||
Result.failure(inputData)
|
||||
} else {
|
||||
Result.success()
|
||||
}
|
||||
} finally {
|
||||
this.workerScope.cancel("Worker finished (withError?=$finishedWithError).")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user