I have several questions about error handling that I need cleared up. As
I understand it, any time one calls an API function the error stack is
cleared prior to the call being executed. Then, all the error that occur
inside of that API call are pushed onto the stack. This behavior happens
on all API functions, including (of particular interest) the H5?close.

So, what happens when one is creating one's own API-like functions. I
have two specific use-cases in mind.

In the first case, I have several functions which are wrappers around
H5Dread, H5Dwrite, H5Aread and H5Awrite.
These wrappers manipulate *and copy* the dataspaces and datatypes, etc.
If any errors occur, the function jumps to the end and closes any
handles that it opened. If I'm understanding what I'm seeing correctly,
when it closes these handles, the error stack is getting cleared.
Therefore, the error that actually caused it to exit is no longer
available to the caller.

In the second case, I have callback functions (for datatype conversion)
which also copy and manipulate some hid_ts. Again, the problem seems to
primary be with the close functions for the copies which execute on
function exit, regardless of whether it's a normal exit or an error exit.

What is the proper method, from outside the API, to handle these issues?

Thanks,
Jason




_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

Reply via email to