QuestionQ89

Scripting and Automation

A developer wants to create a custom subscription center in CloudPages. The developer prefers to write AMPscript, but is also proficient in Server-Side JavaScript. Although the developer is confident that their code is high quality, they still want to gracefully handle unexpected errors to provide the best user experience.

Which feature should be used for this scenario?

  • A Using RaiseError AMPscript function when an error occurs
  • B Wrapping the code in a Server-Side JavaScript Try/Catch block
  • C Wrapping the code in an AMPscript HandleEror block
Explanation

Server-Side JavaScript supports native try/catch blocks, allowing anticipated or unexpected exceptions to be caught so the page can recover, log details, or return a controlled response. AMPscript RaiseError() raises an error rather than providing exception-catching behavior, and AMPscript has no HandleEror block.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!