how to catch the exception from kotlin native in a...
# getting-started
t
how to catch the exception from kotlin native in another language like c#
g
Kotlin Native shouldn’t be different in terms of exception handling from similar C APIs
t
throw exception in kotlin native code. and add try/catch in c#. it doesn't work
try/catch can't catch the exception from kotlin
g
You probably use some kind DllImport Sorry, not familiar with C# to C bindings, so just trying to understand together with you
so I would search in this direction, does it work with standard C
t
not sure if it can work in standard c. I didn't test with C
1678868032552.png
1678868071666.png
1678868084903.png
Here is the simple example above
g
Yeah, interesting, would be great if someone with C# experience would check it. Just curious what is stacktrace
t
The stack trace
g
so there is no C# here at all as I understand
t
yes
the exception is from kotlin
I guess c# doesn't know the exception because it's not managed in the runtime
Can C catch the exception from kotlin? Anyone has idea about that?
k
The C language has no concept of exceptions.