I’ve got what may be an interop nightmare. I’m con...
# getting-started
c
I’ve got what may be an interop nightmare. I’m converting a Java library to Kotlin, and the library has a dependency on a different library implemented in Clojure. The Clojure library throws an IllegalStateException but the Kotlin re-write seems to completely discard that exception when thrown. Is this expected behavior in Kotlin? Is there a way to get the previously expected behavior back?
m
Kotlin doesn't discard exceptions. It does treat checked exceptions as unchecked, so doesn't force you to do a
try
. The exception should still get pushed up, and you can still do a
try/catch
for it if required.
c
@mibac138 that’s what I thought, but the behavior I’m seeing doesn’t seem to match this. I suppose I’ll have to dig into the bytecode to see what’s going on.