Use the tabs on the upper right to switch to a different programming language.

Use the tabs on the upper right to switch to a different programming language.

Use the tabs on the upper right to switch to a different programming language.

Use the tabs on the upper right to switch to a different programming language.

dev_get_exception_dataT_dev_get_exception_dataDevGetExceptionDataDevGetExceptionDatadev_get_exception_data (Operator)

Name

dev_get_exception_dataT_dev_get_exception_dataDevGetExceptionDataDevGetExceptionDatadev_get_exception_data — Access the elements of an exception tuple.

Signature

dev_get_exception_data( : : Exception, Name : Value)

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

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

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

def dev_get_exception_data(exception: Sequence[Union[int, str]], name: MaybeSequence[str]) -> Sequence[Union[int, str]]

Description

The operator dev_get_exception_datadev_get_exception_dataDevGetExceptionDataDevGetExceptionDataDevGetExceptionDatadev_get_exception_data 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_dataDevGetExceptionDataDevGetExceptionDataDevGetExceptionDatadev_get_exception_data. 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_dataDevGetExceptionDataDevGetExceptionDataDevGetExceptionDatadev_get_exception_data. 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_dataDevGetExceptionDataDevGetExceptionDataDevGetExceptionDatadev_get_exception_data is meant to be used within HDevelop or HDevEngine. Some information is not available when the operator is exported.

Supported data slots:

'error_code'"error_code""error_code""error_code""error_code""error_code":

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”.

'add_error_code'"add_error_code""add_error_code""add_error_code""add_error_code""add_error_code":

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".

'error_message'"error_message""error_message""error_message""error_message""error_message":

HALCON error message.

'add_error_message'"add_error_message""add_error_message""add_error_message""add_error_message""add_error_message":

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

'program_line'"program_line""program_line""program_line""program_line""program_line":

Number of the program line, where the error occurred.

'operator'"operator""operator""operator""operator""operator":

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).

'call_stack_depth'"call_stack_depth""call_stack_depth""call_stack_depth""call_stack_depth""call_stack_depth":

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

'procedure'"procedure""procedure""procedure""procedure""procedure":

Name of the procedure where the error occurred.

'user_data'"user_data""user_data""user_data""user_data""user_data":

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_dataDevGetExceptionDataDevGetExceptionDataDevGetExceptionDatadev_get_exception_data call.

Parameters

ExceptionExceptionExceptionExceptionexceptionexception (input_control)  exception-array HTupleSequence[Union[int, str]]HTupleHtuple (integer / string) (int / long / string) (Hlong / HString) (Hlong / char*)

Tuple containing the exception data or user defined error codes.

NameNameNameNamenamename (input_control)  attribute.name(-array) HTupleMaybeSequence[str]HTupleHtuple (string) (string) (HString) (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 HTupleSequence[Union[int, str]]HTupleHtuple (integer / string) (int / long / string) (Hlong / HString) (Hlong / char*)

Requested exception data.

Result

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

Possible Predecessors

catchcatchCatchCatchCatchcatch

See also

trytryTryTryTrytry, catchcatchCatchCatchCatchcatch, endtryendtryEndtryEndtryEndtryendtry, throwthrowThrowThrowThrowthrow, dev_set_checkdev_set_checkDevSetCheckDevSetCheckDevSetCheckdev_set_check

Module

Foundation