-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide meaningful stacktrace on cancellation #1625
Comments
That string should be removed by shrinkers/obfuscators. |
Unfortunately, we cannot provide generic mechanism that will always properly recover a stacktrace.
is quite hard to implement, because
True, but the exception is created in a different place, not in a resumption point To improve the debugging experience, we have a debug mode that copies an exception and enhance the copy with coroutine-related frames (using mechanism quite similar to what you proposed :) ). Unfortunately,
will produce
|
…ide better debugging experience Fixes #1625
…ide better debugging experience Fixes #1625
Sample: https://stackoverflow.com/questions/58482407/is-there-a-way-to-understand-what-the-coroutine-was-doing-when-it-was-cancelled
Output:
Note: neither
test
norproxy
normain
are mentioned in the stack trace.Expected: "at least
test
" should be mentioned (because the coroutine resumes from that function). Ideally,proxy
andwithTimeout
should be present as well.As far as I see, Kotlin-JVM generates state machine like
What if it added and extra string parameter to
throwOnFailure
method likeResultKt.throwOnFailure((Object)$result, "com.acme.Example.test(Example.kt:15)");
?Then failure cases could contain proper stacktraces for cancelation / exceptional outcomes.
The text was updated successfully, but these errors were encountered: