r

    ribesg

    3 years ago
    Is there a built in way to convert a
    Throwable
    into a
    NSError
    or
    NSException
    ?
    r

    ribesg

    3 years ago
    I don’t see anything related to what I asked
    Tobi

    Tobi

    3 years ago
    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

    3 years ago
    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
    Stefan Oltmann

    Stefan Oltmann

    1 year ago
    Still an open question.
    Matthias Geisler

    Matthias Geisler

    1 year ago
    I also like to hear the answer