Skip to main content
Roberty Studio
RPAMy robot

Try Catch

Try 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.