Skip to content

Commit

Permalink
[Gradle, JS] Config errors in webpack
Browse files Browse the repository at this point in the history
#KT-38286 fixed
  • Loading branch information
ilgonmic committed Apr 16, 2020
1 parent 36525d6 commit f8c44be
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ class TeamCityMessageCommonClient(
private val log: Logger,
private val progressLogger: ProgressLogger
) : ServiceMessageParserCallback {

private val stackTraceProcessor = TeamCityMessageStackTraceProcessor()

override fun parseException(e: ParseException, text: String) {
log.error("Failed to parse test process messages: \"$text\"", e)
}
Expand All @@ -30,7 +33,15 @@ class TeamCityMessageCommonClient(
val value = text.trimEnd()
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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ internal class TeamCityMessageStackTraceProcessor {

fun process(text: String, firstLineAction: (String?) -> Unit) {
firstLine = if (text.trim().startsWith("at ")) {
// firstLineAction can have side effects
// that's why important to call it even with null line
firstLineAction(firstLine)
null
} else {
Expand Down

0 comments on commit f8c44be

Please sign in to comment.