ClassesClassesClassesClasses | | | | Operators

Page not available for the currently selected syntax (programming language).

Page not available for the currently selected syntax (programming language).

Page not available for the currently selected syntax (programming language).

Page not available for the currently selected syntax (programming language).

Page not available for the currently selected syntax (programming language).

dev_get_exception_dataT_dev_get_exception_dataDevGetExceptionDatadev_get_exception_dataDevGetExceptionDataDevGetExceptionData (Operator)


dev_get_exception_dataT_dev_get_exception_dataDevGetExceptionDatadev_get_exception_dataDevGetExceptionDataDevGetExceptionData — Access the elements of an exception tuple.


dev_get_exception_data( : : Exception, Name : Value)

Herror T_dev_get_exception_data(const Htuple Exception, const Htuple Name, Htuple* Value)

Herror dev_get_exception_data(const HTuple& Exception, const HTuple& Name, HTuple* Value)

void DevGetExceptionData(const HTuple& Exception, const HTuple& Name, HTuple* Value)

void HOperatorSetX.DevGetExceptionData(
[in] VARIANT Exception, [in] VARIANT Name, [out] VARIANT* Value)

static void HOperatorSet.DevGetExceptionData(HTuple exception, HTuple name, out HTuple value)


The operator dev_get_exception_datadev_get_exception_dataDevGetExceptionDatadev_get_exception_dataDevGetExceptionDataDevGetExceptionData enables to access specific items of an exception tuple that was caught by the operator catchcatchCatchcatchCatchCatch. Except the error code that is always passed as the first element of the exception tuple all other data of the exception tuple has to be accessed exclusively via the operator dev_get_exception_datadev_get_exception_dataDevGetExceptionDatadev_get_exception_dataDevGetExceptionDataDevGetExceptionData. This is due to the fact that the order and the extent of the provided data may change in future versions and may vary for the different code exports.

If an operator error occurred within HDevelop or HDevEngine, the caught exception tuple contains the data items listed below. This tuple has to be passed to the parameter ExceptionExceptionExceptionExceptionExceptionexception. The name of the requested data slot has to be passed to the parameter NameNameNameNameNamename. The requested data is returned in the parameter ValueValueValueValueValuevalue. By passing a tuple of slot names to NameNameNameNameNamename it is possible to request several exception data items in a single call of dev_get_exception_datadev_get_exception_dataDevGetExceptionDatadev_get_exception_dataDevGetExceptionDataDevGetExceptionData. In that case a corresponding data tuple is returned in ValueValueValueValueValuevalue. For requested items that are not available an empty string (''"""""""""") is returned.

Note that the operator dev_get_exception_datadev_get_exception_dataDevGetExceptionDatadev_get_exception_dataDevGetExceptionDataDevGetExceptionData is meant to be used within HDevelop or HDevEngine. Some information is not available when the operator is exported.

Supported data slots:


HALCON or user defined error code. A list of HALCON error codes (codes < 10000) can be found in the appendix of the “Extension Package Programmer's Manual”.


Additional HDevelop specific error code. These error codes specify whether an error was caught within the HALCON operator (code = 21000) or outside the operator, e.g., during the evaluation and assignment of the parameter expressions. In the latter case the error code specifies the error type more precisely. The relevant error codes are listed in the "HDevelop User's Guide".


HALCON error message.


Additional error message that describes the HDevelop specific error more precisely.


Number of the program line, where the error occurred.


Name of the operator that threw the exception (if the exception was thrown in a protected procedure, '--protected--' is returned instead of the operator name).


Depth of the call stack (if the error occurred in 'main' a depth of 1 is returned).


Name of the procedure where the error occurred.


User defined exception tuple. If an operator exception was caught and rethrown, this is the tuple that was appended to the caught exception tuple in the call of throwthrowThrowthrowThrowThrow. In case of a completely user defined exception all tuple items except the first element containing the error code (>= 30000) are returned. If no user data was passed with the exception tuple, an empty tuple is returned. Note, that the user data tuple cannot be requested together with any other exception data in one dev_get_exception_datadev_get_exception_dataDevGetExceptionDatadev_get_exception_dataDevGetExceptionDataDevGetExceptionData call.


ExceptionExceptionExceptionExceptionExceptionexception (input_control)  exception-array HTupleHTupleHTupleVARIANTHtuple (integer / string) (int / long / string) (Hlong / HString) (Hlong / char*) (Hlong / BSTR) (Hlong / char*)

Tuple containing the exception data or user defined error codes.

NameNameNameNameNamename (input_control) HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Name(s) of the requested exception data.

Default value: 'error_code' "error_code" "error_code" "error_code" "error_code" "error_code"

List of values: 'add_error_code'"add_error_code""add_error_code""add_error_code""add_error_code""add_error_code", 'add_error_message'"add_error_message""add_error_message""add_error_message""add_error_message""add_error_message", 'call_stack_depth'"call_stack_depth""call_stack_depth""call_stack_depth""call_stack_depth""call_stack_depth", 'error_code'"error_code""error_code""error_code""error_code""error_code", 'error_message'"error_message""error_message""error_message""error_message""error_message", 'operator'"operator""operator""operator""operator""operator", 'procedure'"procedure""procedure""procedure""procedure""procedure", 'program_line'"program_line""program_line""program_line""program_line""program_line", 'user_data'"user_data""user_data""user_data""user_data""user_data"

ValueValueValueValueValuevalue (output_control)  attribute.value-array HTupleHTupleHTupleVARIANTHtuple (integer / string) (int / long / string) (Hlong / HString) (Hlong / char*) (Hlong / BSTR) (Hlong / char*)

Requested exception data.


If the values of the specified parameters are correct, dev_get_exception_datadev_get_exception_dataDevGetExceptionDatadev_get_exception_dataDevGetExceptionDataDevGetExceptionData (as operator) returns 2 (H_MSG_TRUE). Otherwise an exception is raised and an error code returned.

Possible Predecessors


See also

trytryTrytryTryTry, catchcatchCatchcatchCatchCatch, endtryendtryEndtryendtryEndtryEndtry, throwthrowThrowthrowThrowThrow, dev_set_checkdev_set_checkDevSetCheckdev_set_checkDevSetCheckDevSetCheck



ClassesClassesClassesClasses | | | | Operators