Documentation
¶
Overview ¶
Package jnierr provides JNI exception-to-Go-error conversion.
This is hand-written because exception extraction requires careful use of raw capi calls to avoid infinite recursion (every generated Env method calls CheckException, so it must not use Env methods).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckException ¶
CheckException checks for a pending Java exception on the given JNI env pointer and converts it to a Go error. Returns nil if no exception is pending.
Call sequence:
- ExceptionCheck — is an exception pending?
- ExceptionOccurred — get the jthrowable reference
- ExceptionClear — MUST clear before making more JNI calls
- Extract class name and message from the throwable
- Delete the throwable local ref
- Return *JavaException
Types ¶
type JavaException ¶
JavaException represents a Java exception caught by JNI.
func (*JavaException) Error ¶
func (e *JavaException) Error() string
Error returns a human-readable representation of the Java exception.
Click to show internal directories.
Click to hide internal directories.