|
2.3.4 MathLinkException
MathLinkException is the exception class that is thrown by many of the methods in MathLink and KernelLink. The J/Link API uses exceptions to indicate errors, rather than function return values like the MathLink C API. In C, you write code that checks the return values like this:
// C code
if (!MLPutInteger(link, 42)) {
// was error; print message and clean up.
}
In J/Link, you wrap MathLink calls in a try block and catch MathLinkException.
|