I’m trying to work around the absence of suspend f...
# kotlin-native
j
I’m trying to work around the absence of suspend functions and made something similar as in @Sam example here: https://github.com/samus/mpp_chuck_demo/blob/master/app/src/commonMain/kotlin/com/synappticlabs/chuck/network/JokeApiClient.kt#L39 but get this error:
Copy code
launchAndCatchInstances of kotlin.Error, kotlin.RuntimeException and subclasses aren't propagated from Kotlin to Objective-C/Swift.
Other exceptions can be propagated as NSError if method has or inherits @Throws annotation.
Uncaught Kotlin exception: kotlin.IllegalStateException: There is no event loop. Use runBlocking { ... } to start one.
        at 0   ios                                 0x000000010e0d6bd6 kfun:kotlin.Exception.<init>(kotlin.String?)kotlin.Exception + 70
        at 1   ios                                 0x000000010e0d6af6 kfun:kotlin.RuntimeException.<init>(kotlin.String?)kotlin.RuntimeException + 70
        at 2   ios                                 0x000000010e0e32c6 kfun:kotlin.IllegalStateException.<init>(kotlin.String?)kotlin.IllegalStateException + 70
        at 3   ios                                 0x000000010e1acb4f kfun:kotlinx.coroutines.takeEventLoop#internal + 239
        at 4   ios                                 0x000000010e1ac966 kfun:kotlinx.coroutines.DefaultExecutor.dispatch(kotlin.coroutines.CoroutineContext;kotlinx.coroutines.Runnable) + 86
[...]
any help would be really appreciated 🙂