ClassesClassesClassesClasses | | | | Operators

get_error_textget_error_textGetErrorTextget_error_textGetErrorTextGetErrorText (Operator)

Name

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

Signature

get_error_text( : : ErrorCode : ErrorMessage)

Herror get_error_text(const Hlong ErrorCode, char* ErrorMessage)

Herror T_get_error_text(const Htuple ErrorCode, Htuple* ErrorMessage)

Herror get_error_text(const HTuple& ErrorCode, char* ErrorMessage)

void GetErrorText(const HTuple& ErrorCode, HTuple* ErrorMessage)

static HString HSystem::GetErrorText(Hlong ErrorCode)

void HOperatorSetX.GetErrorText(
[in] VARIANT ErrorCode, [out] VARIANT* ErrorMessage)

BSTR HSystemX.GetErrorText([in] Hlong ErrorCode)

static void HOperatorSet.GetErrorText(HTuple errorCode, out HTuple errorMessage)

static string HSystem.GetErrorText(int errorCode)

Description

The operator get_error_textget_error_textGetErrorTextget_error_textGetErrorTextGetErrorText 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_textget_error_textGetErrorTextget_error_textGetErrorTextGetErrorText 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.

Parallelization

Parameters

ErrorCodeErrorCodeErrorCodeErrorCodeErrorCodeerrorCode (input_control)  integer HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

HALCON error code.

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

ErrorMessageErrorMessageErrorMessageErrorMessageErrorMessageerrorMessage (output_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Corresponding error message.

Example (C)

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);
}

Result

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

Possible Predecessors

set_checkset_checkSetCheckset_checkSetCheckSetCheck

See also

set_checkset_checkSetCheckset_checkSetCheckSetCheck

Module

Foundation


ClassesClassesClassesClasses | | | | Operators