<@U2E974ELT> And what is recommended way to handle...
# coroutines
g
@elizarov And what is recommended way to handle it?
tryResumeWithException
? I understand this behaviour, avoid exception swallowing, but in this particular case looks that this is the only valid option
e
I’m writing an issue about it with the detailed description and available workarounds. Hold on.
g
🙏
cc @Tolriq
g
So, before introduction of new API, it’s impossible to publish library with fix without marking all the APIs without
InternalCoroutinesApi
t
Thanks a lot for the answer and complete description, will investigate and use one of the hack for now as it's hard to give up on coroutines they are so great 🙂
g
One more question, wouldn’t be this exception easy to debug if stack-trace would have
Continuation.resume()
and error message that cause this problem. Looks that this already works like that for cases when you call resume more than one time Because now exception just re-thrown without actual reference to Continuation.resume
t
I too agree on that last one, I had no idea where to look and went to OkHttp guys 🙂
t
just a quick question about UseExperimental, IDE tells mes that I should add -X experimental compilation flag but it seems to compile without it. Anything I should add in the gradle kotlin dsl files for Android ?
g
You can suppress it using compiler flag, if you want
t
Ok so it's just a warning. I'll keep it to remind me of returning to that code at a later point. Thanks.
@elizarov Looking at workaround 1 as for this case I don't really care about exception in that case. Reading at documentation of the privates API do I still need to keep line 2? As it seems the
continuation.tryResumeWithException(exception)?.let { continuation.completeResume(it) }
handle everything no?
e
Yes. You don’t need LINE(2) in this case. Corrected
t
Ok perfect thanks a lot was really hard to understand, will go with that for now with my beta users. I hope https://github.com/Kotlin/kotlinx.coroutines/issues/833 can make it to 1.0.2 as I started to become mad trying to understand how that crash could happen while being catched.
So after a few days in beta I can confirm that this was the source of the crashes and that the workaround 1 does work perfectly. Thanks again for the help, could not have found that alone.
@elizarov Bad news I went to prod and the issue is still present 😞 I'm using this code: https://gist.github.com/Tolriq/dcbdc62c0e29d3b321034e990c3c85ce (Your workaround 1).