Throwing exceptioncs from JBI code

The macro JAMAICA_THROW_EXCEPTION permits to throw an exception from within JBI code. The exception's class and an optional message have to be provided to the macro as illustrated in this code example:

      
if ((index < 0) || (index >= len)) {
  JAMAICA_THROW_EXCEPTION(ct,
                          "java/lang/ArrayIndexOutOfBoundsException",
                          "index parameter out of range");
}