Throw
Type: throw · Package: Core Activities v1.0.0
Throw an error on purpose with the message you indicate. It is used to stop automation when you detect a situation that should not continue — invalid data, a business condition that is not met, an unexpected result. Instead of continuing and confusingly failing later, you fail right there with a clear message.
How it works
Section titled “How it works”When executed, it stops the flow with the indicated error. From there:
- If it is within
tryof a Try / Catch, it jumps to thatcatch(the error is captured). - If there is no Try/Catch containing it, the execution ends in state
failedand the message appears in the logs.
Required parameters
Section titled “Required parameters”| Parameter | Editor | Description |
|---|---|---|
message | expression | The error message. Fixed text or expression =. Ex: = "Invalid total: " + total. |
Optional parameters
Section titled “Optional parameters”Ninguno.
Example
Section titled “Example”Validate a piece of data and abort with a useful message if it is not valid:
If condition = = num(fila["Total"]) <= 0 └─ then: Throw message = = "Invoice " + str(row["Number"]) + " has an invalid total"Related activities
Section titled “Related activities”- Try / Catch — catch a thrown error (your own or from another activity).
- Log — log a warning without stopping execution.
- If — decide when to throw the error.