Vsevolod Ganin
06/27/2022, 1:09 PMtry ... catch ...
in Kotlin while calling interface
method implemented in swift/objc? I saw relatively new ForeignException
but afaik it only works for cinteroped libraries with special flagSam
06/28/2022, 1:46 PMVsevolod Ganin
06/28/2022, 1:57 PMAn error pointer is passed into the function and if after calling the function, it has a value, then the function has generated an error.I’m getting the idea that Kotlin-ObjC interop layer could do this implicitly and rethrow as Kotlin exception if the error pointer has the value. Please correct me if I’m getting a wrong impression
NSException
. For instance, you can take XCTest framework. It throws _XCTestCaseInterruptionException
when assertion fails as the means to stop execution of current test. If your test is written partly in Kotlin and uses XCTest assertions then the whole process just aborts instead of marking test failure and let other test execute.Sam
06/28/2022, 5:46 PM