Benoît03/22/2021, 10:45 AM
Swift object Has anyone managed to fix this issue?
Michal Klimczak03/22/2021, 11:29 AM
Benoît03/22/2021, 11:38 AM
bsimmons03/22/2021, 11:39 AM
Benoît03/23/2021, 9:31 PM
bsimmons03/24/2021, 1:01 PM
to log a non-fatal exception, but right before, I log the real stack trace as a string in the log.
Benoît03/24/2021, 2:40 PM
from the standard library, I do it in the Kotlin code. The Swift Code receives the Throwable and calls a helper function I've made:
However this isn't useful, the String it gives me looks like that:
fun exceptionToString(exception: Throwable): String = exception.freezeObject().stackTraceToString()
kotlin.NotImplementedError: An operation is not implemented. at 0 shared 0x00000001014dd688 shared + 382600 at 1 shared 0x00000001014d6810 shared + 354320 at 2 shared 0x00000001014ca470 shared + 304240 at 3 shared 0x00000001014ca574 shared + 304500 at 4 shared 0x0000000101943c28 shared + 4996136 at 5 shared 0x0000000101945ca4 shared + 5004452 at 6 shared 0x0000000101917688 shared + 4814472 at 7 shared 0x00000001019187ec shared + 4818924 at 8 shared 0x0000000101686ca0 shared + 2124960 at 9 shared 0x0000000101688518 shared + 2131224 at 10 shared 0x0000000101688808 shared + 2131976 at 11 shared 0x00000
bsimmons03/24/2021, 3:01 PM
then wrap your Kotlin code in
and convert it to an
and pass back the exception as a string stack trace. Then in Swift you avoid exceptions altogether and already have the formatted string.
Benoît03/24/2021, 3:10 PM