HALCON operator return values (type Herror) can be divided into two categories:
HALCON operators return H_MSG_TRUE, if no error occurs. Otherwise, a corresponding error value is returned.
Errors in HALCON operators usually result in an exception, i.e., a program abort with the appropriate error message in HALCON/C (default exception handling). However, users can disable this mechanism (with a few exceptions, like errors in Htuple operators), using
set_check("~give_error");
to provide their own error handling routines. In that case, the operator get_error_text is very useful: This operator returns the plain text message for any given error code. Finally, the operator
set_check("give_error");
enables the HALCON error handling again. Several examples showing the handling of error messages can be seen in the file example5.c.