Skip to content

Instantly share code, notes, and snippets.

@zuzannamj
Created June 5, 2020 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zuzannamj/e372901151396dcd2be5ec03b9a5a407 to your computer and use it in GitHub Desktop.
Save zuzannamj/e372901151396dcd2be5ec03b9a5a407 to your computer and use it in GitHub Desktop.
<script runat="server">
Platform.Load("Core","1.1.1");
try{
</script>
{{your script goes here}}
<script runat="server">
}catch(e){
var errorMsg = Stringify(e.message)
Write("Oops, something went wrong!<br>Please contact info@email.com so we can help you finalize your request.");
Variable.SetValue("@err",errorMsg);
}
</script>
%%[
if not empty(@err) then
InsertData('ent.ErrorLogging','SubscriberKey',_SubscriberKey,'MID',memberid,'error',@err)
endif
]%%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment