From 9e0bc0da3ed594d3b8f1e20f58f31e8f59850599 Mon Sep 17 00:00:00 2001 From: Robinson Date: Tue, 27 Apr 2021 13:31:54 +0200 Subject: [PATCH] Fixed stackframe index --- src/dorkbox/network/connection/ListenerManager.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/dorkbox/network/connection/ListenerManager.kt b/src/dorkbox/network/connection/ListenerManager.kt index dc026dd0..9b5cf015 100644 --- a/src/dorkbox/network/connection/ListenerManager.kt +++ b/src/dorkbox/network/connection/ListenerManager.kt @@ -52,17 +52,15 @@ internal class ListenerManager { * Neither of these are useful in resolving exception handling from a users perspective, and only clutter the stacktrace. */ 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 val stackTrace = throwable.stackTrace.filterNot { val stackName = it.className stackName.startsWith("kotlinx.coroutines.") || - stackName.startsWith("kotlin.coroutines.") + stackName.startsWith("kotlin.coroutines.") }.toTypedArray() - var newEndIndex = stackTrace.size + var newEndIndex = stackTrace.size - 1 // maybe offset by 1 because we have to adjust coroutine calls var newStartIndex = 0