Skip to content

get_error_textGetErrorTextGetErrorTextget_error_textget_error_text🔗

Short description🔗

get_error_textGetErrorTextGetErrorTextget_error_textget_error_text — Inquiry after the error text of a HALCON error number.

Signature🔗

get_error_text( integer ErrorCode, out string ErrorMessage )void GetErrorText( const HTuple& ErrorCode, HTuple* ErrorMessage )static void HOperatorSet.GetErrorText( HTuple errorCode, out HTuple errorMessage )def get_error_text( error_code: int ) -> str

Herror get_error_text( const Hlong ErrorCode, char* ErrorMessage )

Herror T_get_error_text( const Htuple ErrorCode, Htuple* ErrorMessage )

static HString HSystem::GetErrorText( Hlong ErrorCode )

static string HSystem.GetErrorText( int errorCode )

Description🔗

The operator get_error_textGetErrorText returns the error message for the corresponding HALCON error code. This is indeed the same text which will be given during an exception. The operator get_error_textGetErrorText is especially useful if the error treatment is programmed by the users themselves (see also set_check(::'~give_error':)).

Attention🔗

Unknown error codes will trigger a standard message.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

ErrorCodeerrorCodeerror_code (input_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

HALCON error code.

Restriction: 1 <= ErrorCode && ErrorCode <= 36000

ErrorMessageerrorMessageerror_message (output_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

Corresponding error message.

Example🔗

(C)

Herror   err\;
char       message[MAX_STRING]\;

set_check("~give_error")\;
err = send_region(region,socket)\;
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)\;
}

Result🔗

The operator get_error_textGetErrorText returns the value 2 (H_MSG_TRUE), if the parameters are correct. Otherwise an exception will be raised.

Combinations with other operators🔗

Combinations

Possible predecessors

set_checkSetCheck

See also

set_checkSetCheck

Module🔗