Almighty-Alpaca / JetBrains-Discord-Integration

Discord rich presence integration for all JetBrains IDEs
https://plugins.jetbrains.com/plugin/10233-discord-integration
Apache License 2.0
582 stars 63 forks source link

NoIPCFile thrown when discord is not running #250

Open duncte123 opened 1 year ago

duncte123 commented 1 year ago

This exception should probably be handled instead of the IDE poping up with an alert

Unhandled exception in [StandaloneCoroutine{Cancelling}@1636fcbd, Dispatchers.Default]

dev.cbyrne.kdiscordipc.core.error.ConnectionError$NoIPCFile: Failed to find an IPC file. Is Discord open? Is this application allowed to access temporary files?
    at dev.cbyrne.kdiscordipc.core.error.ConnectionError$NoIPCFile.<clinit>(ConnectionError.kt)
    at dev.cbyrne.kdiscordipc.core.socket.handler.SocketHandler.findIPCFile(SocketHandler.kt:95)
    at dev.cbyrne.kdiscordipc.core.socket.handler.SocketHandler.findIPCFile(SocketHandler.kt:99)
    at dev.cbyrne.kdiscordipc.core.socket.handler.SocketHandler.findIPCFile(SocketHandler.kt:99)
    at dev.cbyrne.kdiscordipc.core.socket.handler.SocketHandler.findIPCFile(SocketHandler.kt:99)
    at dev.cbyrne.kdiscordipc.core.socket.handler.SocketHandler.findIPCFile(SocketHandler.kt:99)
    at dev.cbyrne.kdiscordipc.core.socket.handler.SocketHandler.findIPCFile(SocketHandler.kt:99)
    at dev.cbyrne.kdiscordipc.core.socket.handler.SocketHandler.findIPCFile(SocketHandler.kt:99)
    at dev.cbyrne.kdiscordipc.core.socket.handler.SocketHandler.findIPCFile(SocketHandler.kt:99)
    at dev.cbyrne.kdiscordipc.core.socket.handler.SocketHandler.findIPCFile(SocketHandler.kt:99)
    at dev.cbyrne.kdiscordipc.core.socket.handler.SocketHandler.findIPCFile(SocketHandler.kt:99)
    at dev.cbyrne.kdiscordipc.core.socket.handler.SocketHandler.findIPCFile(SocketHandler.kt:99)
    at dev.cbyrne.kdiscordipc.core.socket.handler.SocketHandler.connect(SocketHandler.kt:59)
    at dev.cbyrne.kdiscordipc.KDiscordIPC.connect(KDiscordIPC.kt:83)
    at dev.cbyrne.kdiscordipc.KDiscordIPC.connect$default(KDiscordIPC.kt:76)
    at com.almightyalpaca.jetbrains.plugins.discord.plugin.rpc.connection.DiscordIpcConnection$connect$2.invokeSuspend(DiscordIpcConnection.kt:59)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
IS2511 commented 1 year ago

Bump. This issue seems strange to have. Getting an error every time I open my IDE is annoying lowering my attention to IDE exceptions in general, which is not particularly good. :slightly_smiling_face:

xairaven commented 1 year ago

Have the same issue. (WebStorm 2022.3.1)

In addition to this error, another one appears:

kotlin.UninitializedPropertyAccessException: lateinit property randomAccessFile has not been initialized
    at dev.cbyrne.kdiscordipc.core.socket.impl.WindowsSocket.close(WindowsSocket.kt:28)
    at dev.cbyrne.kdiscordipc.core.socket.handler.SocketHandler.disconnect(SocketHandler.kt:67)
    at dev.cbyrne.kdiscordipc.KDiscordIPC.disconnect(KDiscordIPC.kt:118)
    at com.almightyalpaca.jetbrains.plugins.discord.plugin.rpc.connection.DiscordIpcConnection.disconnectInternal(DiscordIpcConnection.kt:77)
    at com.almightyalpaca.jetbrains.plugins.discord.plugin.rpc.connection.DiscordIpcConnection.dispose(DiscordIpcConnection.kt:81)
    at com.intellij.openapi.util.ObjectTree.runWithTrace(ObjectTree.java:127)
    at com.intellij.openapi.util.ObjectTree.executeAll(ObjectTree.java:159)
    at com.intellij.openapi.util.Disposer.dispose(Disposer.java:243)
    at com.intellij.openapi.util.Disposer.dispose(Disposer.java:231)
    at com.almightyalpaca.jetbrains.plugins.discord.plugin.rpc.RpcService$update$1.invokeSuspend(RpcService.kt:115)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

Quick fix (?):

279

Use RPC instead by customizing your IDE properties: (Help > Edit Custom VM Options... and add -Dcom.almightyalpaca.jetbrains.plugins.discord.plugin.rpc.connection=rpc)

Xevion commented 1 year ago

This is occurring for me even with Discord running. System: Pop!_OS 22.04 LTS

I reinstalled Webstorm using JetBrains Toolbox instead of via Flatpak, no change. My solution: After switching Discord from Flatpak to their direct .deb distribution, Discord Integration began working again.