Skip to content

Conversation

simolus3
Copy link
Contributor

@simolus3 simolus3 commented Jul 9, 2025

We used to have two runWrapped methods responsible for reporting unhandled exceptions as PowerSyncException: runWrapped and runWrappedSuspending. The latter used to re-throw cancellation exceptions unchanged (as it should), but the former was missing that logic.

This merges the two methods into a single inline function that can be used from both suspending and non-suspending contexts, ensuring the implementation is the same. This then ensures cancellation exceptions are properly rethrown by both.

Closes #215

@simolus3 simolus3 requested a review from stevensJourney July 9, 2025 07:21
@simolus3 simolus3 merged commit dfe2620 into main Jul 9, 2025
14 of 27 checks passed
@simolus3 simolus3 deleted the refactor-runWrapped branch July 9, 2025 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

runWrapped incorrectly wraps kotlin.coroutines.cancellation.CancellationException

2 participants