diff --git a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/internal/plugin/JarPluginLoaderImpl.kt b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/internal/plugin/JarPluginLoaderImpl.kt index 333e6009a..1a840b648 100644 --- a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/internal/plugin/JarPluginLoaderImpl.kt +++ b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/internal/plugin/JarPluginLoaderImpl.kt @@ -32,7 +32,9 @@ import java.net.URLClassLoader internal object JarPluginLoaderImpl : AbstractFilePluginLoader(".jar"), - CoroutineScope, + CoroutineScope by MiraiConsole.childScope("JarPluginLoader", CoroutineExceptionHandler { _, throwable -> + JarPluginLoaderImpl.logger.error("Unhandled Jar plugin exception: ${throwable.message}", throwable) + }), JarPluginLoader { override val configStorage: PluginDataStorage @@ -44,11 +46,6 @@ internal object JarPluginLoaderImpl : override val dataStorage: PluginDataStorage get() = MiraiConsoleImplementationBridge.dataStorageForJarPluginLoader - override val coroutineContext: CoroutineContext = - MiraiConsole.childScopeContext("JarPluginLoader", CoroutineExceptionHandler { _, throwable -> - logger.error("Unhandled Jar plugin exception: ${throwable.message}", throwable) - }) - internal val classLoaders: MutableList = mutableListOf() @Suppress("EXTENSION_SHADOWED_BY_MEMBER") // doesn't matter