diff --git a/common/src/commonMain/kotlin/com/artemchep/keyguard/common/service/execute/impl/ExecuteCommandImpl.kt b/common/src/commonMain/kotlin/com/artemchep/keyguard/common/service/execute/impl/ExecuteCommandImpl.kt index 724bb90..040f83a 100644 --- a/common/src/commonMain/kotlin/com/artemchep/keyguard/common/service/execute/impl/ExecuteCommandImpl.kt +++ b/common/src/commonMain/kotlin/com/artemchep/keyguard/common/service/execute/impl/ExecuteCommandImpl.kt @@ -89,7 +89,11 @@ private suspend fun executeCommand(array: Array) { Runtime.getRuntime().exec(array) } coroutineScope { - val errorText = process.errorReader().readText() + val errorText = runCatching { + process.errorStream.reader().use { + it.readText() + }.trim() + }.getOrNull() val exitCode = process.waitFor() if (exitCode != 0) {