~4 min9 / 16

Error Handling

Genzbots provides three layers of error control: per-activity flags, the Try Catch container, and the Retry container. Use them together to build automations that survive real-world failures.

Per-Activity Error Flags

Every activity in the Properties Panel has two universal settings:

SettingDescription
Continue on ErrorIf true, a failure marks the activity as failed but the workflow continues to the next step. Useful for optional steps.
Retry CountAutomatically retry this activity up to N times before propagating the error. Applies a short delay between attempts.
Use sparinglySetting Continue on Error = true on critical steps (login, data submission) silently swallows failures and can leave the workflow in an unexpected state. Prefer Try Catch for important steps.

Try Catch Activity

Wraps activities in Try / Catch / Finally branches:

  • Try — the activities you want to protect
  • Catch — runs if anything in Try throws; the exception is available as a variable
  • Finally — always runs (even if Try succeeds), ideal for cleanup
workflow
1Try Catch:
2 Try:
3 Launch Browser: Chrome, url = "https://app.example.com"
4 Click: loginButton
5 Type Into: usernameField, text = "{username{"}"}"
6 Type Into: passwordField, text = "{password{"}"}"
7 Catch:
8 Log: "Login failed — {lastException.Message{"}"}", level = Error
9 Assign: jobStatus = "Failed"
10 Finally:
11 Log: "Login attempt finished"

Retry Activity

Wraps a sequence and re-runs it on failure, up to a configurable number of attempts.

ParameterDescription
Number of retriesMaximum retry attempts (1–10)
Retry intervalWait between attempts in ms (default: 1000)
BodyActivities to retry
workflow
1Retry: 3 times, interval = 2000ms
2 Body:
3 Click: submitButton // retries up to 3× if element not found

Throw & Rethrow

  • Throw — raises a new exception with a custom message, stopping execution (or triggering a surrounding Catch)
  • Rethrow — inside a Catch block, re-raises the original exception so it propagates up to the next Try Catch
workflow
1If: "{orderAmount{"}"}" > 50000
2 Then:
3 Throw: "Order exceeds maximum allowed amount"

Recommended Pattern

  • Wrap every UI interaction (Click, Type Into, Get Text) in Try Catch
  • Log errors with context: "Failed at step X — ${lastException.Message}"
  • Use Retry (3×, 500 ms) for flaky selectors before propagating as a failure
  • Always close browsers/applications in a Finally block
  • Set Continue on Error = true only for genuinely optional side-steps
Was this helpful?