The current code relies on developers to ensure that no exceptions are thrown from their code since unhandled exceptions will kill the JVM. This PR introduces macros which wrap every JNI method body to ensure most exceptions are caught and propagated to the JVM gracefully. Relying on exceptions also allows us to simplify a lot of error handling.
This PR also handles errors from JNI methods that were not handled before.
Description
The current code relies on developers to ensure that no exceptions are thrown from their code since unhandled exceptions will kill the JVM. This PR introduces macros which wrap every JNI method body to ensure most exceptions are caught and propagated to the JVM gracefully. Relying on exceptions also allows us to simplify a lot of error handling.
This PR also handles errors from JNI methods that were not handled before.
Validation performed
Validated all unit tests continue to pass.