Wondering if anyone can shed light on ordinals #3-5 for the RaiseError() function? Particularly interested in #5.

Ref: https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-programmatic-content.meta/mc-programmatic-content/raiseerror.htm

1 Answer 1


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

  1. Your custom error message to display once error is pushed.

  2. Indicator for if the function will continue throughout the dataset of your subscribers, or cancel the entire job. This is mostly only used inside send time environments. True (1) skips to the next subscriber, False (0) halts the process completely.

  3. This is the custom 'API Error code' that you can set. The API Error code is kept in the error log (which I believe is only viewable to SFMC, but I believe you can get part of it via 'NotSent' tracking extract) and any send log you have set up. The error code is not a number, but a small descriptor. e.g. 'Unsubscribed'.

  4. 'API error number' is a custom set number you set that is sent to the error log and send log same as API Error Code. This number, like the code, would mostly be used for your own reference only and does not affect anything else.

  5. If you set this to True (1), then it will allow all the processed information (via Update, Insert, Upsert AMPScript or SSJS functions) prior to RaiseError to still be processed and inserted/updated. If you set this to False (0) then any processed information that you had set prior to the RaiseError will not be added in or updated.

Check here for a full list of existing error codes and numbers

To further elaborate on #5, Think of it like this:

With True:

    UpsertDE(@yourDE, 1, "pkey", @pkey, "attr1", @attr1)
    if @broken == 1 THEN

        RaiseError("Broken", true, "Broken", 66, 1)


The Upsert Function will still process and the record will be inserted/updated on the @yourDE Data Extension.

With False:

    UpsertDE(@yourDE, 1, "pkey", @pkey, "attr1", @attr1)
    if @broken == 1 THEN

        RaiseError("Broken", true, "Broken", 66, 0)


The Upsert Function will NOT be processed and the record will NOT be inserted/updated on the @yourDE Data Extension.

  • Does this still work as intended? I cannot get RaiseError events to be logged in the Send Log at all. Alert Manager doesn't even trigger an alert.
    – user80446
    Commented May 4, 2022 at 23:12
  • @Jordan - As far as I know there has been no change to the functionality of RaiseError() Commented May 5, 2022 at 13:22
  • 2
    then it's broken or bugged because it's no longer triggering entries into the Send Log. I opened a support ticket so we'll see what they say.
    – user80446
    Commented May 9, 2022 at 13:11
  • You have to SET whatever Data Extension function you want to persist even if the RaiseError is triggered. So, instead of... UpsertDE(@yourDE, 1, "pkey", @pkey, "attr1", @attr1) Use... SET @UpsertSomething = UpsertDE(@yourDE, 1, "pkey", @pkey, "attr1", @attr1) ...and the data will be retained, even when the RaiseError cancels the send.
    – Will
    Commented Dec 28, 2022 at 21:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .