mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
Build infrastructure: fall back to single-byte encoding in case of process output reading errors
GitOrigin-RevId: 615450cd7cac07b73c1a90df1f62ff70ee2a58e3
This commit is contained in:
committed by
intellij-monorepo-bot
parent
e8b97f16d8
commit
cf2d95ef40
@@ -11,6 +11,7 @@ import io.opentelemetry.api.trace.Span
|
||||
import kotlinx.coroutines.*
|
||||
import org.jetbrains.intellij.build.TraceManager.spanBuilder
|
||||
import java.io.File
|
||||
import java.nio.charset.MalformedInputException
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.Path
|
||||
import kotlin.time.Duration
|
||||
@@ -121,8 +122,13 @@ suspend fun runJava(mainClass: String,
|
||||
|
||||
private fun checkOutput(outputFile: Path, span: Span, errorConsumer: (String) -> Unit) {
|
||||
val out = try {
|
||||
try {
|
||||
Files.readString(outputFile)
|
||||
}
|
||||
catch (_: MalformedInputException) {
|
||||
Files.readString(outputFile, Charsets.ISO_8859_1)
|
||||
}
|
||||
}
|
||||
catch (e: NoSuchFieldException) {
|
||||
span.setAttribute("output", "output file doesn't exist")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user