# Try-Catch Blocks, failure responses and rollback

*Omnistudio Developer Study Guide · Integration Procedures · Last updated October 27, 2026 · https://www.certifyforce.com/study-guide/omnistudio-developer/integration-procedures/try-catch-blocks-failure-responses-and-rollback*

How to set up a Try-Catch Block with Fail on Block Error and Fail On Step Error, return a Failure Response or run a Custom Failure Response class, define custom failures with a Failure Conditional Formula, read HTTP status codes, and keep a failed Data Mapper Load from saving partial records.

- Certification: Salesforce Omnistudio Developer
- Exam section: Integration Procedures
- Study guide: https://www.certifyforce.com/study-guide/omnistudio-developer

**Official exam objective:**

> Implement robust exception handling using Try/Catch blocks to manage failures and ensure proper rollback.

## What the exam expects

- Set up a Try-Catch Block so a failing step triggers its catch behavior: Fail on Block Error on the block, Fail On Step Error on each step that must trigger it.
- Configure the catch behavior with a Failure Response, a Custom Failure Response, or both.
- Define a custom failure with a Failure Conditional Formula, return only the failure data with Send Only Failure Response, and know the list-returning limitation.
- Find an HTTP Action's status code in the data JSON.
- Keep a failed Data Mapper Load from saving part of its records with Rollback On Error.

Key terms: **Try-Catch Block** (runs the steps inside it and catches the error if a step fails), **Fail on Block Error** (if the block fails, the whole procedure fails), **Fail On Step Error** (the procedure ends if this step fails; "Terminate when step fails" in the standard designer), **Failure Response** (key/value pairs returned on failure), **Custom Failure Response** (an Apex class and method run on failure), **Failure Conditional Formula** (a custom failure test that runs after the step).

## Key facts

| Fact | Detail | Source |
|---|---|---|
| Fail on Block Error | If the block fails, the entire procedure fails; setup says keep it checked | [Try-Catch Block](https://help.salesforce.com/s/articleView?id=xcloud.os_try_catch_block.htm&language=en_US), [Try-Catch setup](https://help.salesforce.com/s/articleView?id=xcloud.os_handle_errors_using_try_catch_blocks_49845.htm&language=en_US&type=5) |
| Step trigger | Fail on Step Error on each step that must trigger the catch | [Try-Catch setup](https://help.salesforce.com/s/articleView?id=xcloud.os_handle_errors_using_try_catch_blocks_49845.htm&language=en_US&type=5) |
| Standard designer label | Terminate when step fails | [IP Actions](https://help.salesforce.com/s/articleView?language=en_US&id=xcloud.os_integration_procedure_actions_50165.htm&type=5) |
| Catch options | Failure Response, Custom Failure Response, or both | [Try-Catch Block](https://help.salesforce.com/s/articleView?id=xcloud.os_try_catch_block.htm&language=en_US) |
| Failure Response value | A formula; merge fields from Spring '20 | [Try-Catch setup](https://help.salesforce.com/s/articleView?id=xcloud.os_handle_errors_using_try_catch_blocks_49845.htm&language=en_US&type=5) |
| Custom Failure Response class | System.Callable on Standard Runtime | [Supported Features](https://help.salesforce.com/s/articleView?id=sf.os_omnistudio_and_omnistudio_for_vlocity_products_and_features_support.htm&language=en_US&type=5) |
| Failure Conditional Formula | Runs after the step; can't use returned data from a list-returning action | [Error handling](https://help.salesforce.com/s/articleView?id=sf.os_error_handling_in_integration_procedures_55179.htm&language=en_US&type=5) |
| Send Only Failure Response | Returns only the failure response when the action fails | [IP Actions](https://help.salesforce.com/s/articleView?language=en_US&id=xcloud.os_integration_procedure_actions_50165.htm&type=5) |
| HTTP status code | In the ElementNameInfo node with headers and status | [Error handling](https://help.salesforce.com/s/articleView?id=sf.os_error_handling_in_integration_procedures_55179.htm&language=en_US&type=5) |
| Rollback On Error | Load doesn't create or update sObjects if errors occur | [Data Mapper Load](https://help.salesforce.com/s/articleView?id=sf.os_object_field_mapping_47137.htm&language=en_US&type=5) |

## Check yourself

- Why does a Failure Conditional Formula on a list-returning Extract never fire on a value in the list?
- When does a step inside a Try-Catch Block trigger the block's catch behavior?
- Why choose Rollback On Error over Ignore Errors for an order and its lines?
- Where do you read the status code of an HTTP Action named SendLabel?

## Sources

- [Handle Errors by Using a Try-Catch Block](https://help.salesforce.com/s/articleView?id=xcloud.os_handle_errors_using_try_catch_blocks_49845.htm&language=en_US&type=5)
- [Try-Catch Block](https://help.salesforce.com/s/articleView?id=xcloud.os_try_catch_block.htm&language=en_US)
- [Handle Errors in Integration Procedures](https://help.salesforce.com/s/articleView?id=sf.os_error_handling_in_integration_procedures_55179.htm&language=en_US&type=5)
- [Integration Procedure Actions](https://help.salesforce.com/s/articleView?language=en_US&id=xcloud.os_integration_procedure_actions_50165.htm&type=5)
- [Configure an Omnistudio Data Mapper Load](https://help.salesforce.com/s/articleView?id=sf.os_object_field_mapping_47137.htm&language=en_US&type=5)
- [Supported Features in Omnistudio and Omnistudio for Managed Packages](https://help.salesforce.com/s/articleView?id=sf.os_omnistudio_and_omnistudio_for_vlocity_products_and_features_support.htm&language=en_US&type=5)

## About the full unit

The "Core concepts", "Exam traps" and "Worked scenario" sections of this unit, its 6 linked practice questions, and unlimited timed mock exams are included with the Omnistudio Developer pack (USD $19): https://www.certifyforce.com/practice-exams
