function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Anusha KasaragaddaAnusha Kasaragadda 

Unable to catch exception in ampscript

I have to raise an error with custom message when i got exception in my ampscript code.I used SSJS try catch but I am unable to raise an error .When I did preview in exact target it's showing exact target exception message not my custom message like 

There is an error in your email. Please contact your customer service representative. Error 1: Script SET Statement Invalid<br>An error occurred when attempting to resolve a script expression. See inner exception for detail. Script Expression: [Product_Test] MemberID: 510003494 JobID: 0 An unrecognized expression appears in a script block. Script Expression: [Product_Test] MemberID: 510003494 JobID: 0 <br>Invalid Content: <br>set @email = [Product_Test]

here is my code ,Prdouct_Test is not existed in my DE, it should execute catch block.

<script runat="server">
Platform.Load("Core","1.1.1");
try{
</script>

 %%[
 set @error=""
 set @email = [Product_Test]
 ]%%

<script runat="server">
  }catch (e) {          
    Variable.SetValue("@error", "Error Occured");
  }
</script>
%%[
if not empty(@error) then
%%[RaiseError(@error, true);]%%
endif
]%%

 
Please suggest how to catch exception in ampscript. Thanks in advance.

gfdbhg gvfdgfgfdbhg gvfdgf
I am looking for a new type of software and for this purpose you can click here (https://startmyhouse.com/best-solar-generator/) and learn some details about it. Please check and follow the steps.