Has someone used SKIE and knows how to handle exce...
# multiplatform
s
Has someone used SKIE and knows how to handle exceptions in suspend functions? I can call my suspend functions and i like to use Skie but my suspend functions are throwing exceptions in the shared KMP. With native Coroutines i could handle them pretty good but i found nothing how to handle this with skie.
f
Hi! Exceptions in suspend functions work exactly the same way as for other Kotlin functions exposed to Swift. So you need to add the Throws annotation to your Kotlin code and then use the
try
syntax of Swift (you can read more here: https://kotlinlang.org/docs/native-objc-interop.html#errors-and-exceptions)
s
Thanks, helped a lot. i missed the Throw annotation with Exception class. @Filip Dolník 🙂