[starter eel] AT-1851 Do not throw on attempt to deregister unknown eel

GitOrigin-RevId: ec9849e6935bec339b0afd7565448a20de248f28
This commit is contained in:
Nikita Kudrin
2025-02-06 10:14:05 +00:00
committed by intellij-monorepo-bot
parent 8850b5e6ff
commit 33f29fde86
2 changed files with 9 additions and 2 deletions
@@ -1,6 +1,8 @@
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.execution.ijent.nio
import com.intellij.openapi.diagnostic.currentClassLogger
import com.intellij.openapi.diagnostic.getOrLogException
import com.intellij.platform.eel.provider.EelNioBridgeService
import com.intellij.platform.eel.provider.LocalEelDescriptor
import com.intellij.platform.ijent.IjentApi
@@ -55,7 +57,8 @@ fun CoroutineScope.registerIjentNioFs(ijent: IjentApi, root: String, internalNam
}
this.awaitCancellationAndInvoke {
service.deregister(ijent.descriptor)
runCatching { service.deregister(ijent.descriptor) }
.getOrLogException { currentClassLogger().warn("Unable to deregister eel descriptor ${ijent.descriptor}", it) }
}
// Compute a path after registration
@@ -6,7 +6,9 @@ import com.intellij.execution.wsl.WslDistributionManager
import com.intellij.execution.wsl.WslIjentManager
import com.intellij.execution.wsl.ijent.nio.IjentWslNioFileSystem
import com.intellij.execution.wsl.ijent.nio.IjentWslNioFileSystemProvider
import com.intellij.openapi.diagnostic.currentClassLogger
import com.intellij.openapi.diagnostic.debug
import com.intellij.openapi.diagnostic.getOrLogException
import com.intellij.openapi.diagnostic.logger
import com.intellij.platform.eel.provider.EelNioBridgeService
import com.intellij.platform.ijent.community.impl.IjentFailSafeFileSystemPosixApi
@@ -119,7 +121,9 @@ class IjentWslNioFsToggleStrategy(
enabledInDistros.forEachGuaranteed { distro ->
val descriptor = WslEelDescriptor(distro)
val service = EelNioBridgeService.getInstanceSync()
service.deregister(descriptor)
runCatching {
service.deregister(descriptor)
}.getOrLogException { currentClassLogger().warn("Unable to deregister eel descriptor $descriptor", it) }
}
}
}