-
Notifications
You must be signed in to change notification settings - Fork 451
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
Keep stack traces in withError
#3573
Conversation
Kover Report
|
callsInPlace(transform, AT_MOST_ONCE) | ||
} | ||
// recover({ return block(this) }) { raise(transform(it)) } | ||
val raise = DefaultRaise(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this mean that innerException
would always have no stack trace?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would that be the case? As I understand the inner stack trace comes from the point where the RaiseCancellationException
is first thrown.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, the inner exception is always going to be a NoTrace
because it's created by a DefaultRaise(false)
. Otherwise, we would be creating a stack trace every time, which would defeat our optimizations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is definitely true!
It was too good to be true... |
This is an attempt to fix #3351. The idea is to "inline" the definition of
withError
, and within it carefully copy stack traces. Since the "inner exception" already contains the stack trace including anywithError
, we just need to copy it, not change it in any way.