#1816 java.lang.Throwable vs. sys:Err

dobesv Wed 7 Mar 2012

For Java FFI is there much interoperability with exceptions?

Specifically, can I use a Throwable as the "cause" for an Err so that the stack trace is preserved? Or is there some simple way to convert Throwable to Err?

brian Wed 7 Mar 2012

Err is just a special subclass of RuntimeException. Non-Fantom exceptions are converted into best fit Fantom type (see Err.java). To convert Java FFI see:

Err Interop.toFan(Throwable ex)
Throwable Interop.toJava(Err err)

Login or Signup to reply.