jagrosh/DiscordIPC

Error while closing the stream in IPCClient#close

Opened this issue · 4 comments

Hello @jagrosh

I'm receiving this error while calling the function IPCClient#close which it should close everything safety but it appears an exception that I can't handle it by try and catch because it's in a different thread. So, I hope there's a solution for this error.

21:25:26.238 [Thread-11] ERROR com.jagrosh.discordipc.IPCClient - Reading thread encountered an IOException
java.io.IOException: Stream Closed
    at java.io.RandomAccessFile.length(Native Method)
    at com.jagrosh.discordipc.entities.pipe.WindowsPipe.read(WindowsPipe.java:56)
    at com.jagrosh.discordipc.IPCClient.lambda$startReading$0(IPCClient.java:350)
    at java.lang.Thread.run(Thread.java:748)

Marking this as a bug.

For now, since it's in a separate thread, then you can just ignore it (and if you don't want to see it at all, use your logging dependency to hide errors from IPCClient).

Well, Could we have a way to disable the error from the logger like setLogLevel. It will be useful to just let the IPCClient log whatever we want for having a useful log. 😄

IPCClient doesn't impose any particular logging dependency on you, it utilizes SLF4J, so you already can set the logging level to whatever you wish using your logging dependency

Thanks, @jagrosh for helping me. I appreciate it 😄