Skip to content

Commit 4da644f

Browse files
authored
Fix java.lang.IllegalStateException: No match available (#28)
1 parent f4da0af commit 4da644f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

json-log-viewer/shared/src/main/scala/ru/d10xa/jsonlogviewer/LogViewerStream.scala

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ import ru.d10xa.jsonlogviewer.logfmt.LogfmtLogLineParser
1313
import ru.d10xa.jsonlogviewer.shell.ShellImpl
1414

1515
import scala.util.matching.Regex
16+
import scala.util.Failure
17+
import scala.util.Success
18+
import scala.util.Try
1619

1720
object LogViewerStream {
1821

@@ -118,7 +121,12 @@ object LogViewerStream {
118121
effectiveConfig.timestamp.before
119122
)
120123
)
121-
.map(outputLineFormatter.formatLine)
124+
.map(pr =>
125+
Try(outputLineFormatter.formatLine(pr)) match {
126+
case Success(formatted) => formatted.toString
127+
case Failure(_) => pr.raw
128+
}
129+
)
122130
.map(_.toString)
123131
} yield evaluatedLine
124132

0 commit comments

Comments
 (0)