Open
Description
If discord is closed while discord ipc is connected, DiscordIPC.isConnected()
will still return true but setActivity()
will fail and log the message with the following code. Users have no way of knowing if setActivity()
failed or not. Instead of just printing the error, this should throw and let users handle the error.
Potential Fix
Catch the error, stop the connection, and throw the error up. This stops the connection properly and also lets users handle the error. This also allows users to have custom logging methods instead of just printStackTrace
.
protected void write(ByteBuffer buffer) throws IOException {
try {
sc.write(buffer);
} catch (IOException e) {
DiscordIPC.stop();
throw e;
}
}
Metadata
Metadata
Assignees
Labels
No labels