diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/DelayedRun.kt')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/DelayedRun.kt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/DelayedRun.kt b/src/main/java/at/hannibal2/skyhanni/utils/DelayedRun.kt index 3c6491ac3..0b4c3adc9 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/DelayedRun.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/DelayedRun.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.utils +import at.hannibal2.skyhanni.test.command.ErrorManager import at.hannibal2.skyhanni.utils.CollectionUtils.drainTo import java.util.concurrent.ConcurrentLinkedQueue import kotlin.time.Duration @@ -22,7 +23,11 @@ object DelayedRun { tasks.removeIf { (runnable, time) -> val inPast = time.isInPast() if (inPast) { - runnable() + try { + runnable() + } catch (e: Exception) { + ErrorManager.logErrorWithData(e, "DelayedRun task crashed while executing") + } } inPast } |