Raise errors

You can raise custom errors using the raise syntax, and you can catch and handle errors using a try/except block.

Errors can be either a string or a map. You can use user-defined keys:

YAMLJSON
  - STEP_NAME:
      raise:
          KEY_1: VALUE_1
          KEY_2: VALUE_2
  [
    {
      "STEP_NAME": {
        "raise": {
          "KEY_1": "VALUE_1",
          "KEY_2": "VALUE_2"
        }
      }
    }
  ]

Examples

String

YAMLJSON
  - step_a:
      raise: "Something went wrong."
  [
    {
      "step_a": {
        "raise": "Something went wrong."
      }
    }
  ]

Map

YAMLJSON
  - step_a:
      raise:
          code: 55
          message: "Something went wrong."
  [
    {
      "step_a": {
        "raise": {
          "code": 55,
          "message": "Something went wrong."
        }
      }
    }
  ]

What's next