Use the Fail activity to cause pipeline execution to fail with a customized error message and error code
You might occasionally want to throw an error in a pipeline intentionally. A Lookup activity might return no matching data, or a Script activity might finish with an internal error. Whatever the reason might be, now you can use a Fail activity in a pipeline and customize both its error message and error code.
Prerequisites
To get started, you must complete the following prerequisites:
- A tenant account with an active subscription. Create an account for free.
- A workspace is created.
Add a Fail activity to a pipeline with UI
To use a Fail activity in a pipeline, complete the following steps:
Creating the activity
Create a new pipeline in your workspace.
Search for the Fail activity in the pipeline Activities pane, and select it to add it to the pipeline canvas. It might be necessary to expand the activities list on the far right side of the pane, or the Outlook icon can be compressed without labeling text beneath it, as shown in this image, depending on the window width of your browser.
Select the new Fail activity on the canvas if it isn't already selected.
Refer to the General settings guidance to configure the General settings tab.
Fail activity settings
Select the Settings tab and provide a custom error message and error code you would like the pipeline to report when the activity is invoked.
Save and run or schedule the pipeline
The Fail activity is typically used with other activities. After you configure any other activities required for your pipeline, switch to the Home tab at the top of the pipeline editor, and select the save button to save your pipeline. Select Run to run it directly, or Schedule to schedule it. You can also view the run history here or configure other settings.