error(pulse)

xod/core/error(pulse)

Raises an error when the `ERR` input pin receives the `True` value. Otherwise, it fires the pulse on the `OUT` pin when the `IN` pin receives a pulse.
error(pulse)
@/error(pulse)
Raises an error when the `ERR` input pin receives the `True` value. Otherwise, it fires the pulse on the `OUT` pin when the `IN` pin receives a pulse.
INpulse
A pulse to pass through the node.
ERRboolean
The node raises an error on the `True` value.
error(pulse)
OUT
IN
ERR
OUTpulse
The pulse passed through the node.

C++ implementation

#pragma XOD evaluate_on_pin disable
#pragma XOD evaluate_on_pin enable input_IN
#pragma XOD error_raise enable

node {
    void evaluate(Context ctx) {
        if (!isInputDirty<input_IN>(ctx))
            return;

        if (getValue<input_ERR>(ctx))
            raiseError<output_OUT>(ctx);
        else
            emitValue<output_OUT>(ctx, 1);
    }
}