fix: ignore Stream closed exceptions on flush (#7610)

Solves: CON-3587

This exception occurs if continue-binary is killed or throws some unexpected error, but in the previous version, the exception would bubble up and be logged as an IDE error (visible for users).

After this change, we catch this exception and only log it, because there's no point in throwing it. The handler still recognizes this invalid state and gracefully restarts the binary.
This commit is contained in:
Jakub Błach 2025-09-05 21:35:16 +02:00 • committed by GitHub
parent cce90a7cea
commit 6789833a77
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -43,10 +43,14 @@ class ContinueProcessHandler(
}
scope.launch(Dispatchers.IO) {
for (message in pendingWrites) {
log.debug("Write: $message")
writer.write(message)
writer.write("\r\n")
writer.flush()
try {
log.debug("Write: $message")
writer.write(message)
writer.write("\r\n")
writer.flush()
} catch (e: IOException) {
log.warn(e)
}
}
}
}