[MINC-development] MINC2 API error handling

Andrew Janke a.janke at gmail.com
Tue Dec 11 17:01:47 EST 2012


Hi Vlad,

> another issue in MINC2 API - is almost complete lack of error reporting and
> sometimes checking. I.e functions are sometimes quietly returning MI_ERROR ,
> and sometimes there is no check for the error from underlying HDF5 call.
> I've been recently inserting code pieces like:
> https://github.com/BIC-MNI/libminc/blob/minc_lite/libsrc2/hyper.c#L606
>
> which is printing some info on stderr. Which is not the most elegant way for
> handling errors, especially for some GUI program.
>
> Would anyone have some other suggestions?

Ideally this should all be done via minc_error.

   https://github.com/BIC-MNI/minc/blob/master/libsrc/minc_error.h

Perhaps adding a method that doesn't require an entry in a great big
enum would be useful.

The idea was that in time we'd add code to this such that you could
redirect the error from stderr to somewhere else via a function call
so that GUI's could capture this output.  There also was a plan to add
calls to this to log errors at various levels but this was never done.

a


More information about the MINC-development mailing list