Skip to main content

assert

Syntax Format

assert(condition[, message])

Overview

The assert function stops the script execution if the condition is false. Emits the error message to log. The function is useful for debugging.

Parameters

ParameterTypePurpose
conditionbooleanA condition to assert on
messagestringAn optional error message

Example

value = -1
assert(value > 0, "The value is not a positive number")