<@U0ZFBBUBU> Take a look at this example: <https:/...
# announcements
i
@groostav Take a look at this example: https://try.kotlinlang.org/#/UserProjects/q1qp3un899nd41tcall8qmapg5/9kedig2qt02lre65kj8jt9eqan What is different from your code?
🤔 1
g
ilya.gorbunov: Oh, of course, the obvious bit. try
Copy code
override fun fillInStackTrace(): Throwable{
  println(trace.lines())
}
i
So why can't you move that code from
fillInStackTrace
to
init
?
g
because I'm trying to modify the stack trace...
and I had it in my head that you can only do that from
fillInStackTrace
but thats not right, thats just a performance optimization
if I do it from init it'l cause the JVM to build the stack trace once, then over-write that result, which means I burn a little CPU time, but no other problems
or no, thats not right either, I can simply override
fillInStackTrace
to no-op, then
setStackTrace
in the init call
sorry I'm really confused with this API, thanks Ilya.
i
np