Skip to content

Support default-throw cancellationException when suspendOnException triggers #476

@l2hyunwoo

Description

@l2hyunwoo

Is your feature request related to a problem?

When suspendOnException is triggered within the library, it unintentionally catches CancellationException as a generic exception.
Since CancellationException is special in Kotlin coroutines, capturing it as a standard exception interferes with coroutine cancellation mechanisms, potentially causing coroutine leakages, unexpected continuation of work, or incorrect error reporting.

Describe the solution you'd like:

Modify the behavior of suspendOnException so that it re-throws the CancellationException by default, preserving the intended coroutine cancellation semantics.
This ensures that coroutines can terminate correctly and exceptions are handled explicitly rather than being caught generically.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions