What is good way to get better errors in xcode log...
# kotlin-native
k
What is good way to get better errors in xcode log? Now i errors that are hard to map to root cause: Instances of kotlin.Error, kotlin.RuntimeException and subclasses aren't propagated from Kotlin to Objective-C/Swift. Other exceptions can be propagated as NSError if method has or inherits @Throws annotation. Uncaught Kotlin exception: kotlin.UninitializedPropertyAccessException
t
Use checked + @throws, that's it
s
The problem is that
UninitializedPropertyAccessException
is subclass of
RuntimeException
and thus can’t be converted to
NSError
. @Konstantin Petrukhnov does the error log have proper Kotlin stacktrace?
k
@thevery where? in kotlin? ios code? I'm not throwing anything explicitly.
t
In kotlin. But if you are not throwing that's another question of course.
k
no, error don't have kotlin stacktrace
In my case it is rare error, that lead to app crash. But as i can't reproduce it reliably, i would like to have some better logs in future.
Should i try/catch runtime exception and wrap it in kotlin? or isit better to do something similar in Swift?
t
You can't catch runtime exception in swift anyway