https://kotlinlang.org logo
r

ribesg

02/19/2019, 9:53 AM
Is there a built in way to convert a
Throwable
into a
NSError
or
NSException
?
r

ribesg

02/19/2019, 12:54 PM
I don’t see anything related to what I asked
t

Tobi

02/19/2019, 1:18 PM
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
2 Views