File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
src/commonMain/kotlin/spp.protocol/artifact/exception Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -83,9 +83,9 @@ class LiveStackTrace(
8383
8484 fun fromString (data : String ): LiveStackTrace ? {
8585 return when {
86+ nodeFrameRegex.containsMatchIn(data) -> extractNodeStackTrace(data)
8687 frameRegex.containsMatchIn(data) -> extractJvmStackTrace(data)
8788 pythonFrameRegex.containsMatchIn(data) -> extractPythonStackTrace(data)
88- nodeFrameRegex.containsMatchIn(data) -> extractNodeStackTrace(data)
8989 else -> null
9090 }
9191 }
@@ -99,9 +99,12 @@ class LiveStackTrace(
9999 val line = el.groupValues[3 ].toInt()
100100 val column = el.groupValues[4 ].toInt()
101101
102- elements.add(LiveStackTraceElement (method, " $file :$line " ))
102+ elements.add(LiveStackTraceElement (method, " $file :$line " , column ))
103103 }
104- return LiveStackTrace (" n/a" , " n/a" , elements)
104+ val firstLine = data.split(" \n " ).first()
105+ val exceptionType = firstLine.split(" :" ).firstOrNull() ? : " n/a"
106+ val message = firstLine.split(" : " ).drop(1 ).firstOrNull() ? : " n/a"
107+ return LiveStackTrace (exceptionType, message, elements)
105108 }
106109
107110 private fun extractPythonStackTrace (data : String ): LiveStackTrace {
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ import spp.protocol.instrument.variable.LiveVariable
3030data class LiveStackTraceElement (
3131 val method : String ,
3232 val source : String ,
33+ val column : Int? = null ,
3334 val variables : MutableList <LiveVariable > = mutableListOf(),
3435 var sourceCode : String? = null
3536) {
You can’t perform that action at this time.
0 commit comments