Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Fix traced CCE when nested different types. #3337
Fix traced CCE when nested different types. #3337
Changes from 1 commit
25b8a1b
54bfd71
5fe16bb
12d2cee
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
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.
We can't do this because of #3235 unless we
@PublishedApi
RaiseCancellationException
.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.
I've been contemplating doing this.. but I've been a bit absent last 2 months due to some personal things keeping me busy.
My rationale for making it public is because I've had a scenario or two where I wanted to differentiate between
RaiseCancellationException
, and (Job
)CancellationException
. It's in really low-level edge case scenarios though, but it would allow figuring out if theCancellationException
comes from Arrow, from KotlinX Coroutines, or from somewhere else.Perhaps it warrants
@DelicateApi
or something, like KotlinX does to force@OptIn
so it requires "flagging" low-level code.WDYT?
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.
I think giving users that option is a good idea, especially because we already have tests confirming that
try-catch
can recover from raise. We'd have to make both Raise exceptions public thus. It's another question if we should allow inspecting the error, too.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.
Initially I would say don't expose it if we don't have a need for it.
I got a small WIP, that relies on some new functionality and unofficial support of Kotlin 😅
It adds a
public sealed class
, with expect/actual implementation to disable the stack traces.I'm going to raise it as a PR targeting this one, so we can discuss further based on a code example☺️
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.
This can now be replaced by the sealed public error for
Raise
, and then this PR is ready to be merged IMO 🥳 🙌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.
Do we need to make this part of the API? It feels that it can be directly placed in the code.
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.
It encapsulates doing a check with the
RaiseCancellationException
, which is private. I can instead make it@PublishedAPI internal