When an error occurs in an HDF5 library call, the JHI5 retrieves the major error code and minor code from the HDF5 library error stack. An instance of ncsa.hdf.hdf5.exceptions.HDF5LibraryException is raised based on the major error code and the error message is put into the exception according to the minor error code. The JHI5 detects the error, and raises an HDF5FileInterfaceException . The detailed error message from the HDF5 library error stack is printed on the Java console, followed by the standard Java stack trace. Error detected in thread 0.
Back trace follows.
Alternatively, the exception handling code could generate an alert dialog or other appropriate action instead of printing the stack. The former may occur due to errors in calling parameters or other programming errors. The latter may occur due to resource exhaustion or attempts to use unsupported data types. For example, an attempt to write an array of non-numerical objects will fail. Also, if an array is very large, the data conversion may not be able to obtain sufficient memory, which will generate an exception.