[Gradle, JS] Refactor check on error
#KT-38109 fixed
This commit is contained in:
+2
-2
@@ -48,8 +48,8 @@ class TeamCityMessageCommonClient(
|
||||
|
||||
if (inStackTrace) return
|
||||
|
||||
when (type) {
|
||||
LogType.ERROR, LogType.WARN -> errors.add(value.clearAnsiColor())
|
||||
if (type?.isErrorLike() == true) {
|
||||
errors.add(value.clearAnsiColor())
|
||||
}
|
||||
|
||||
type?.let { log.processLogMessage(value, it) }
|
||||
|
||||
+4
@@ -66,6 +66,10 @@ enum class LogType(val value: String) {
|
||||
DEBUG("debug"),
|
||||
LOG("log");
|
||||
|
||||
fun isErrorLike(): Boolean {
|
||||
return this == ERROR || this == WARN
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun byValueOrNull(value: String?): LogType? {
|
||||
if (value == null) return null
|
||||
|
||||
+2
-4
@@ -451,10 +451,8 @@ class KotlinKarma(override val compilation: KotlinJsCompilation) :
|
||||
val actualText = if (launcherMessage != null) {
|
||||
val (logLevel, message) = launcherMessage.destructured
|
||||
actualType = LogType.byValueOrNull(logLevel.toLowerCase())
|
||||
when (actualType) {
|
||||
LogType.WARN, LogType.ERROR -> {
|
||||
processFailedBrowsers(text)
|
||||
}
|
||||
if (actualType?.isErrorLike() == true) {
|
||||
processFailedBrowsers(text)
|
||||
}
|
||||
message
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user