When a native function or delegate encounters an error with the arguments sent,
the last reference parameter should be set to the appropriate enum value.
A specific exception can be thrown by setting the flag to RETURN_VALUE_IS_EXCEPTION and
returning a string.
If an exception is thrown directly inside a native function, the user will not be able to
see a traceback of the script source code lines where the error occurred.
Note: with the redesign of the virtual machine, native bindings can now directly throw
a ScriptRuntimeException as long as the native function is called from a script.
When a native function or delegate encounters an error with the arguments sent, the last reference parameter should be set to the appropriate enum value. A specific exception can be thrown by setting the flag to RETURN_VALUE_IS_EXCEPTION and returning a string. If an exception is thrown directly inside a native function, the user will not be able to see a traceback of the script source code lines where the error occurred. Note: with the redesign of the virtual machine, native bindings can now directly throw a ScriptRuntimeException as long as the native function is called from a script.