Skip to main content

Throw Exception

Stops the run on purpose with an error message you write. Use it to fail fast on bad input, unexpected API responses, or branches that should never be reached.

Parameters​

NameRequiredDefaultDescription
Error message (message)Yes—The error text. Supports expressions, e.g. Order {{ $trigger.body.id }} has no line items.

Ports​

PortDescription
main (input)The step(s) that lead to the failure.

There is no regular output — the step always fails.

Behaviour​

The step fails with your message and is treated like any other failing step — the message shows in the run page, and the failure is handled by whatever error handling you have set up (see Error handling). With none, the run fails.

  • If the message is empty, the error is An error was thrown.
  • Objects and numbers in the message are rendered as text.
  • If the message expression itself fails, the error is An error was thrown (the message expression failed: …).

Example​

After a Switch on the event type, connect Fallback to a Throw Exception step:

  • Error message: Unsupported event type: {{ $trigger.body.type }}

Unknown events now fail visibly instead of silently finishing.