So if Swift or Objective-C code calls a Kotlin method which throws an exception to be handled, then the Kotlin method should be marked with a @Throws annotation. In this case all Kotlin exceptions (except for instances of Error, RuntimeException and subclasses) are translated into a Swift error/NSError.
The interoperability should handle that for you.
r
ribesg
02/19/2019, 3:29 PM
Not really, I just have a function that has a
Throwable
parameter and calls a function taking a
NSError
. I’m not talking about automatic thrown error translation
s
Stefan Oltmann
07/26/2021, 2:25 PM
Still an open question.
m
Matthias Geisler
07/30/2021, 7:50 PM
I also like to hear the answer
a
Anum Amin
08/17/2025, 11:14 AM
Hello folks, do we have an update on it? Can we manually convert
Throwable
into
NSError
? Or if there is an alternate? I need to check if it is a network/connectivity error from kotlin