Checking return value herr_t

Hi,

  I am looking for example of how one should check the return value
herr_t and possibly print user readable text from the return code.

  Looking at the tutorial examples and online search, I don't seems to
be able to find examples of that.

  If someone could point me to some URL I can read further, that would
be awesome.

Regards

I'm assuming you're using the C interface. Generally speaking, unless you tell it otherwise, the library will print an error stack on return that goes into detail about the error. You can find some information about this here:
http://www.hdfgroup.org/HDF5/doc/RM/RM_H5E.html

The H5Eprint2 function is the function that gets called. H5Eset_auto2 and H5Eget_auto2 can change it to something else (or nothing at all so error processing is not done).

The value for herr_t is <0 on failure, >=0 on success, same for every return value for every API in the library. The value itself doesn't generally provide any more information than that. If you need more detail about the error that isn't being provided by the default error handler, I believe you need to examine the contents of the current error stack.

Nicholas Yue wrote:

···

Hi,

  I am looking for example of how one should check the return value
herr_t and possibly print user readable text from the return code.

  Looking at the tutorial examples and online search, I don't seems to
be able to find examples of that.

  If someone could point me to some URL I can read further, that would
be awesome.

Regards

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org