Skip to content

get_error_textGetErrorTextGetErrorTextget_error_textget_error_text🔗

説明🔗

get_error_textGetErrorTextGetErrorTextget_error_textget_error_text — HALCON エラー番号に対するエラー内容を問い合わせる。

書式🔗

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 )

説明🔗

オペレーター get_error_textGetErrorText は、HALCON エラーコードに対応す るエラーメッセージを返します。これは、実際に例外処理中に与えられるものと 同じです。エラー処置をユーザー自身がプログラムする場合、オペレー ター get_error_textGetErrorText は特に有用です (set_check(::'~give_error':) も参照してください)。

注意🔗

未知のエラーコードに対しては標準のメッセージが返されます。

実行情報🔗

実行情報
  • マルチスレッドタイプ: リエントラント(非排他なオペレーターと並列に動作)

  • マルチスレッドスコープ: グローバル(他のスレッドから呼び出される可能性あり)

  • 並列演算処理には未対応

パラメーター🔗

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

HALCON エラーコード

制限: 1 <= ErrorCode && ErrorCode <= 36000

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

対応するエラーメッセージ

例🔗

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

結果🔗

パラメーターが正しい場合、オペレーター get_error_textGetErrorText は値 2 (H_MSG_TRUE) を返します。 それ以外の場合には例外処理が発生します。

他のオペレーターとの組み合わせ🔗

組み合わせ

前処理の候補

set_checkSetCheck

関連項目

set_checkSetCheck

モジュール🔗