Skip to main content
My robot

Try and catch

Try and catch

Tries to run a block of actions and, if anything fails, runs an alternative error-handling block instead — without stopping the robot. It captures information about the error for logging or reprocessing.


Options

Number of attempts

How many times the try block runs before the error block is triggered. Default: 1. Anything above 1 makes the robot retry automatically on a failure.

Returns

The outputs below are available inside the error block, after a failure.

Javascript code

js
actions["action-id"].actionId // the ID of the action that raised the error (text)
actions["action-id"].message // a readable error message (text)
actions["action-id"].error // the complete error object (any)

Field selection

  • actionId — the identifier of the action that failed (text).
  • message — a readable description of the error (text).
  • error — the complete error object, for closer inspection (any).

Rules and conditions

  • The try block runs first. If nothing fails, the error block is skipped.
  • If an action fails inside the try block and attempts remain, the whole block restarts from the beginning.
  • Once the attempts run out, the error block runs.
  • actionId, message and error are only populated in the error block; in the try block they are empty.
  • Number of attempts has to be a whole number greater than zero.