[Gradle, JS] Config errors in webpack

#KT-38286 fixed
This commit is contained in:
Ilya Goncharov
2020-04-14 20:01:39 +03:00
parent 36525d6534
commit f8c44be865
2 changed files with 14 additions and 1 deletions
@@ -16,6 +16,9 @@ class TeamCityMessageCommonClient(
private val log: Logger, private val log: Logger,
private val progressLogger: ProgressLogger private val progressLogger: ProgressLogger
) : ServiceMessageParserCallback { ) : ServiceMessageParserCallback {
private val stackTraceProcessor = TeamCityMessageStackTraceProcessor()
override fun parseException(e: ParseException, text: String) { override fun parseException(e: ParseException, text: String) {
log.error("Failed to parse test process messages: \"$text\"", e) log.error("Failed to parse test process messages: \"$text\"", e)
} }
@@ -30,7 +33,15 @@ class TeamCityMessageCommonClient(
val value = text.trimEnd() val value = text.trimEnd()
progressLogger.progress(value) progressLogger.progress(value)
type?.let { log.processLogMessage(value, it) } var actualType = type
stackTraceProcessor.process(text) { line ->
actualType = ERROR
if (line != null) {
printMessage(line, actualType)
}
}
actualType?.let { log.processLogMessage(value, it) }
} }
override fun regularText(text: String) { override fun regularText(text: String) {
@@ -10,6 +10,8 @@ internal class TeamCityMessageStackTraceProcessor {
fun process(text: String, firstLineAction: (String?) -> Unit) { fun process(text: String, firstLineAction: (String?) -> Unit) {
firstLine = if (text.trim().startsWith("at ")) { firstLine = if (text.trim().startsWith("at ")) {
// firstLineAction can have side effects
// that's why important to call it even with null line
firstLineAction(firstLine) firstLineAction(firstLine)
null null
} else { } else {