From 1f8bae64c08cfa2474e67d6a6c59cae4193b49fe Mon Sep 17 00:00:00 2001 From: Freya Arbjerg Date: Tue, 17 Oct 2023 10:57:20 +0200 Subject: [PATCH] Add try/catch around NodeImpl.check() --- .../schlaubi/lavakord/audio/internal/AbstractLavakord.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/commonMain/kotlin/dev/schlaubi/lavakord/audio/internal/AbstractLavakord.kt b/core/src/commonMain/kotlin/dev/schlaubi/lavakord/audio/internal/AbstractLavakord.kt index d573066d..07adbdb0 100644 --- a/core/src/commonMain/kotlin/dev/schlaubi/lavakord/audio/internal/AbstractLavakord.kt +++ b/core/src/commonMain/kotlin/dev/schlaubi/lavakord/audio/internal/AbstractLavakord.kt @@ -26,6 +26,7 @@ import kotlinx.coroutines.launch import kotlinx.serialization.modules.SerializersModule import kotlinx.serialization.modules.contextual import kotlinx.serialization.modules.plus +import kotlin.Exception import kotlin.collections.set import kotlin.time.Duration.Companion.seconds @@ -146,7 +147,11 @@ public abstract class AbstractLavakord internal constructor( NodeImpl(serverUri, finalName, password, this) nodesMap[finalName] = node launch { - node.check() + try { + node.check() + } catch (e: Exception) { + LOG.warn(e) { "Failed to perform version and plugin checks on ${node.host}. Adding anyways..." } + } node.connect() } }