Handling java exceptions from SWIG interface.