Any tips for the kind of breadcrumbs I could be to...
# coroutines
s
Any tips for the kind of breadcrumbs I could be tossing around?
d
I don't think you're missing any of the stacktrace. Coroutines track the stacktrace and reliable put it back together across thread context switches.
s
But I am
Where was the coroutine called?
The error could have originated from anywhere in my codebase
g
Maybe you could reproduce it on some simple example
s
I'm not asking for help with this specific issue: I want to get a stacktrace or some kind of breadcrumb of the original network request originating from my app. Where did it come from?
Dunno if that clarifies it? Or maybe I'm missing the big picture?
cc @elizarov
d
The error did not originate in your code base, as the stacktrace suggests. A timeoutexception was thrown by okio library. What guarantees that it should originate in your code somewhere??? Coroutine stacktraces work well, please have some trust in what's on the screen and stop making a fuss.
1
g
I agree with Dico, it looks strange that there are no coroutines in stacktrace, this exception was never caught. This is why I asked about some sample that reproduces this problem with coroutines to at least investigate
@SUPERCILEX I understand now your problem, probably you don’t use debug mode of coroutines Such stacktrace is standard thing for async API, you can try do the same with okhttp3.Callback, without wrapping to additional exception or using some sort of logging you will have only such stacktrace
s
@gildor thanks for understanding the problem. So are you saying if I catch the exceptions thrown from my network request and rethrow a wrapped version, it'll have a stacktrace from my codebase?
If I logged stuff, it still wouldn't be helpful AFAIK because multiple async things could start and I wouldn't know which one of them failed.
g
@SUPERCILEX I updated my OkHttp adapter library README with some examples of how you may debug async exceptions, all those advices may be used not only for OkHttp https://github.com/gildor/kotlin-coroutines-okhttp/blob/master/README.md#debugging If something is not very clear, be free to ask or send PR
s
Thanks for the write up!