[MINC-development] MINC2 API error handling
Vladimir S. FONOV
vladimir.fonov at gmail.com
Tue Dec 11 17:10:43 EST 2012
Hello,
so, that would require putting macros like
MI_SAVE_ROUTINE_NAME/MI_RETURN_ERROR/MI_LOG_PKG_ERROR2 in all minc2 api
functions?
On 12-12-11 05:01 PM, Andrew Janke wrote:
> 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.
--
Best regards,
Vladimir S. FONOV ~ vladimir.fonov <at> gmail.com
More information about the MINC-development
mailing list