sfmc // AMPscriptSTUDY

RaiseError() for a Broken Recipient, Not Segmentation

Abort only the current recipient when a genuine rendering invariant is violated.

ampscriptraiseerrorerror handling
Context Pack →Open Workspace →
Trust & provenanceSTUDY
Evidence tierSTUDYOfficial sources1Other sources0Last verified2026-10-05

Evidence tier describes my hands-on relationship with the content. Official sources describe platform contracts/documentation. Production observations should not automatically be treated as official limits.

EvidenceSTUDY
Difficultyintermediate
Verified2026-10-05
Use when

A required invariant is missing and sending the message would be unsafe/wrong.

%%[
VAR @customerId
SET @customerId = AttributeValue("CustomerId")

IF Empty(@customerId) THEN
  RaiseError("CustomerId missing", true)
ENDIF
]%%
Why it works

With boolSkipCurrentOnly=true, RaiseError skips the current recipient and allows the rest of the job to continue.

Gotchas

Salesforce recommends RaiseError for errors, not audience segmentation.

Tracking/reporting can still include emails that were not sent because RaiseError was called.

Sources / verification