Hi, When I use this method print throwable, it pri...
# kotlin-native
w
Hi, When I use this method print throwable, it prints without stack line number. Any other method could print with line number? or any body can give me some reference? TKS
Copy code
throwable.printStack()
from
io/ktor/utils/io/ExceptionUtilsJs.kt:
Copy code
kotlin.native.concurrent.InvalidMutabilityException: mutation attempt of frozen kotlinx.coroutines.ChildHandleNode@38b8508
    at 0   iosApp                              0x0000000101f24adf kfun:kotlin.Throwable#<init>(kotlin.String?){} + 95
    at 1   iosApp                              0x0000000101f1d5cd kfun:kotlin.Exception#<init>(kotlin.String?){} + 93
    at 2   iosApp                              0x0000000101f1d83d kfun:kotlin.RuntimeException#<init>(kotlin.String?){} + 93
    at 3   iosApp                              0x0000000101f544dd kfun:kotlin.native.concurrent.InvalidMutabilityException#<init>(kotlin.String){} + 93
    at 4   iosApp                              0x0000000101f548af ThrowInvalidMutabilityException + 431
    at 5   iosApp                              0x0000000102051590 MutationCheck + 128
    at 6   iosApp                              0x00000001021605f8 kfun:kotlinx.coroutines.internal.LinkedListNode#<set-_next>(kotlinx.coroutines.internal.LinkedListNode){} + 104
    at 7   iosApp                              0x000000010216099d kfun:kotlinx.coroutines.internal.LinkedListNode#addLast(kotlinx.coroutines.internal.LinkedListNode){} + 285
    at 8   iosApp                              0x0000000102160ce8 kfun:kotlinx.coroutines.internal.LinkedListNode#addOneIfEmpty(kotlinx.coroutines.internal.LinkedListNode){}kotlin.Boolean + 232
    at 9   iosApp                              0x00000001021131c1 kfun:kotlinx.coroutines.JobSupport.promoteSingleToNodeList#internal + 465
    at 10  iosApp                              0x0000000102111e8a kfun:kotlinx.coroutines.JobSupport#invokeOnCompletion(kotlin.Boolean;kotlin.Boolean;kotlin.Function1<kotlin.Throwable?,kotlin.Unit>){}kotlinx.coroutines.DisposableHandle + 2010
    at 11  iosApp                              0x0000000102111631 kfun:kotlinx.coroutines.JobSupport#invokeOnCompletion(kotlin.Function1<kotlin.Throwable?,kotlin.Unit>){}kotlinx.coroutines.DisposableHandle + 209
    at 12  iosApp                              0x00000001022aab42 kfun:io.ktor.client#HttpClient(io.ktor.client.engine.HttpClientEngineFactory<0:0>;kotlin.Function1<io.ktor.client.HttpClientConfig<0:0>,kotlin.Unit>){0┬ž<io.ktor.client.engine.HttpClientEngineConfig>}io.ktor.client.HttpClient + 1138
    at 13  iosApp                              0x00000001022eed90 kfun:io.ktor.client#HttpClient(kotlin.Function1<io.ktor.client.HttpClientConfig<*>,kotlin.Unit>){}io.ktor.client.HttpClient + 640
    at 14  iosApp                              0x00000001022eefb0 kfun:io.ktor.client#HttpClient$default(kotlin.Function1<io.ktor.client.HttpClientConfig<*>,kotlin.Unit>?;kotlin.Int){}io.ktor.client.HttpClient + 304
    at 15  iosApp                              0x0000000101e7e9e8 kfun:wu.seal.app.idle.common.newslist.model.NewsListRepositoryImp.$loadDataCOROUTINE$8#invokeSuspend(kotlin.Result<kotlin.Any?>){}kotlin.Any? + 3800
    at 16  iosApp                              0x0000000101e80f75 kfun:wu.seal.app.idle.common.newslist.model.NewsListRepositoryImp#loadData(<http://kotlin.Int;kotlin.Int|kotlin.Int;kotlin.Int>){}wu.seal.app.idle.common.base.ResponseData<kotlin.collections.List<wu.seal.app.idle.common.newslist.model.News>> + 309
    at 17  iosApp                              0x0000000101e81b2f kfun:wu.seal.app.idle.common.newslist.usercase.LoadMoreNewsListUserCase.$executeCOROUTINE$9#invokeSuspend(kotlin.Result<kotlin.Any?>){}kotlin.Any? + 1455
    at 18  iosApp                              0x0000000101e82896 kfun:wu.seal.app.idle.common.newslist.usercase.LoadMoreNewsListUserCase#execute(){} + 246
    at 19  iosApp                              0x0000000101e79a9d kfun:wu.seal.app.idle.common.newslist.NewsListPresenter.$executeLoadMoreNewsListUserCase$lambda-2COROUTINE$7.invokeSuspend#internal + 749
k
Is that from
ExceptionUtilsJs
? It looks like a native stack trace. Not that it matters, but the
Js
implies it's coming from something else. Anyway...
I'd have to poke around. You can get actual line numbers when you push to Crashlytics, etc. I assume there's a way to do that locally, but I haven't looked into it too much (you can usually figure out what's wrong from function list and debugging, but line number would be nice).
­čśŐ 1
Today is a lot of native code, so I'll keep this in mind while poking around.
w
@kpgalligan Thanks for clarifying, Actually I hope we could see the crash or stacktrace line number in debug mode just like Java, aHa,Yep, we could figure out the problem from function list and debugging in most time. Thank you for your hot help.