Error handling

check instruction

Description

The check instruction is used to check (ensure) that a given condition is fulfilled.

If the checked condition is fulfilled then the script execution continues normally. If it is not fulfilled, the script execution stops immediately, and an error object is created and returned to the script caller.

The check instruction checks attributes, as well as command input and output conditions. Therefore, it can only be used in the following check scripts:

Syntax

Table 8.23. check syntax

ProductionSyntaxLinks
check_instruction "check" condition error_info ? the section called “check instruction”
condition the section called “condition
error_info ( "error_message" ":" expression ) ? ( "error_id" ":" identifier ) ? ( "error_data" ":" expression ) ? the section called “error info

  • condition is an expression of type yes_no that evaluates to yes if the condition is fulfilled. For more information see the section called “condition

  • error_info is an optional clause used to return more specific error data if the condition is not fulfilled (e.g. a localized error message). For more information see the section called “error info