Michal Klimczak
12/31/2024, 2:20 PMtry
on swift side even if the original functions do not have @Throws
annotation. I am wondering if this is by design or some limitation or maybe due to cancellation?Filip Dolník
01/06/2025, 9:53 AMMichal Klimczak
01/14/2025, 8:24 AMtry! await myNonThrowingSuspendFunction.invoke()
because it will never throw? Or will it throw and crash upon cancellation of the swift Task and thus the wrapped coroutine? And therefore I should rather gracefully handle some kind of an error?Filip Dolník
01/14/2025, 8:33 AMtry
and let the exception propagate to the Task root, or sometimes also try?
if you are ok with the cancellation being represented as no-op or nil
. Rarely you would do do catch
with some other handling. As for try!
- you can use it only if you are 100 % sure the code cannot be cancelled (from both Kotlin and Swift). That doesn’t mean I would recommend to use that even in that case. It can always cause problems somewhen later when the code changes without respecting this ruleMichal Klimczak
01/14/2025, 10:29 AM