throwNew

context(env: JniEnv, autofreeScope: AutofreeScope)
fun throwNew(clazz: JClass, message: CValuesRef<ByteVar>?)(source)

Constructs an exception object from the specified clazz with the message and causes that exception to be thrown.

Parameters

clazz

a subclass of java.lang.Throwable

message

the message used to construct the java.lang.Throwable object in the null-terminated modified UTF-8. Use String.modifiedUtf8 to get it, or if you are sure that your string doesn't have illegal characters you may use optimized String.utf8.


context(env: JniEnv, autofreeScope: AutofreeScope)
inline fun throwNew(clazz: JClass, message: String)(source)

Alias for throwNew which accepts the message as a Kotlin String.