Operators |
get_error_text — Inquiry after the error text of a HALCON error number.
get_error_text( : : ErrorNumber : ErrorText)
The operator get_error_text returns the error text for the corresponding HALCON error number. This is indeed the same text which will be given during an exception. The operator get_error_text is especially useful if the error treatment is programmed by the users themselves (see also set_check(::'~give_error':) ).
Unknown error numbers will trigger a standard message.
Number of the HALCON error.
Restriction: 1 <= ErrorNumber && ErrorNumber <= 36000
Corresponding error text.
Herror err; char message[MAX_STRING]; set_check("~give_error"); err = send_region(region,socket_id); set_check("give_error"); if (err != H_MSG_TRUE) { get_error_text((Hlong)err,message); fprintf(stderr,"my error message: %s\n",message); exit(1); }
The operator get_error_text returns the value 2 (H_MSG_TRUE), if the parameters are correct. Otherwise an exception will be raised.
Foundation
Operators |