Handle Errors Using Try-Catch Blocks (Managed Package)

For the managed package runtime, a Try-Catch Block lets you "try" running the steps inside it and then "catch" the error if a step fails.

Managed Package app icon This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see Omnistudio Help.

Try-Catch Blocks are available in Summer '19 and later releases.

To set up a Try-Catch Block:

  1. Drag a Try-Catch Block into the Structure panel and make sure its Fail on Block Error checkbox is checked.
  2. Configure the "catch" behavior — what the Try-Catch Block will do if a failure occurs. You can choose one or both of these options:
    • Under Failure Response, specify a key-value pair to return as the response. The value can be a formula. In Spring '20 and later releases, the value can include merge fields.

    • Under Custom Failure Response, specify a Remote Class and a Remote Method to execute an Apex class. The Apex class must implement VlocityOpenInterface.

  3. Drag substeps into the Try-Catch Block, and make sure the Fail on Step Error checkbox is checked for each step that must trigger the "catch" behavior if it fails.

    You can optionally specify a Failure Condition Formula, which evaluates to TRUE if a specific step has failed to execute successfully.

  • Try-Catch Block Properties (Managed Package)
    For the managed package runtime, these properties are unique to or function in a unique manner in Try-Catch Blocks. A Try-Catch Block lets you "try" running the steps inside it and then "catch" the error if a step fails.
  • Create a Try-Catch Block Example (Managed Package)
    For the managed package runtime, an Integration Procedure creates and deletes a Contact with the specified LastName and returns an error message if the LastName is blank.
  • Create a Try-Catch Block Example with a Formula (Managed Package)
    For the managed package runtime, an Integration Procedure finds Contacts with the specified Name and returns an error message if none are found. Because returning no records normally isn't considered a failure, the Omnistudio Data Mapper Extract Action within the Try-Catch Block includes a Failure Condition Formula.