RaiseError

Overview

Raises the error given in string and stops processing of job. If optional B1 is included with a value of true, this function stops the send for the current subscriber only.

Syntax

RaiseError(1, 2, 3, 4, 5)

Function Properties

OrdinalTypeDescription
1stringRequiredError message to display
2booleanIndicates whether function skips send for current subscriber and continues or stops. A value of true skips the send for current subscriber and moves to next subscriber. A value of false stops the send and returns an error. Function defaults to false.
3stringAPI error code
4stringAPI error number
5booleanIndicates whether the function records information to data extensions before error occurs, even if the process skips the subscriber. A value of 1 retains information written to data extensions before the error occurs, even if the subscriber is skipped. A value of 0 does not retain information recorded before the error. This parameter refers to inserted, updated, upserted, or deleted information via AMPscript.

Usage

System returns the error message 'An Error Occurred' and stops the job.

System returns the error message 'Do not send to subscriber' and stops the send to that subscriber only.

RaiseError should not be used to exclude subscribers from a journey, because it will only remove a subscriber from a specific send. A journey decision split testing the raiseerror can be used to bypass the send.

NOTE: Because the system pre-processes and builds these emails, tracking and reporting numbers include these emails despite the errors and may cause inaccuracies. Use this function to handle the errors of a small number of subscribers, rather than as a method to segment out large numbers of subscribers. Instead, use query activities and exclusion lists to handle your segmentation needs.