Skip to content

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.

When executed, it stops the flow with the indicated error. From there:

  • If it is within try of a Try / Catch, it jumps to that catch (the error is captured).
  • If there is no Try/Catch containing it, the execution ends in state failed and the message appears in the logs.
ParameterEditorDescription
messageexpressionThe error message. Fixed text or expression =. Ex: = "Invalid total: " + total.

Ninguno.

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