Fixed stackframe index
This commit is contained in:
parent
ed76209925
commit
9e0bc0da3e
@ -52,17 +52,15 @@ internal class ListenerManager<CONNECTION: Connection> {
|
|||||||
* Neither of these are useful in resolving exception handling from a users perspective, and only clutter the stacktrace.
|
* Neither of these are useful in resolving exception handling from a users perspective, and only clutter the stacktrace.
|
||||||
*/
|
*/
|
||||||
fun cleanStackTrace(throwable: Throwable) {
|
fun cleanStackTrace(throwable: Throwable) {
|
||||||
// NOTE: when we remove stuff, we ONLY want to remove the "tail" of the stacktrace, not ALL parts of the stacktrace
|
|
||||||
|
|
||||||
// we never care about coroutine stacks, so filter then to start with
|
// we never care about coroutine stacks, so filter then to start with
|
||||||
val stackTrace = throwable.stackTrace.filterNot {
|
val stackTrace = throwable.stackTrace.filterNot {
|
||||||
val stackName = it.className
|
val stackName = it.className
|
||||||
stackName.startsWith("kotlinx.coroutines.") ||
|
stackName.startsWith("kotlinx.coroutines.") ||
|
||||||
stackName.startsWith("kotlin.coroutines.")
|
stackName.startsWith("kotlin.coroutines.")
|
||||||
}.toTypedArray()
|
}.toTypedArray()
|
||||||
|
|
||||||
|
|
||||||
var newEndIndex = stackTrace.size
|
var newEndIndex = stackTrace.size - 1
|
||||||
|
|
||||||
// maybe offset by 1 because we have to adjust coroutine calls
|
// maybe offset by 1 because we have to adjust coroutine calls
|
||||||
var newStartIndex = 0
|
var newStartIndex = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user