I have a triggered send email consisting of Ampscript, in this template we are using a lot of personalization which is coming through XML in the triggered send data extension. So the issue is if the triggered send fails in background it tries 3-4 times and then MC pauses the triggered send definition.
In such error scenario the admin should at least know about the error and for that what I am trying is adding try catch to the email template Ampscript using SSJS, and with that in the catch block I am trying to insert error logs in a data extension, after that i have written a script which will fetch the error log Data extensions data into a triggered send Data extension and an email with the error will should be sent to the admin(which is a hard-coded value),I am not sure whether I am going correct or not.
I just want the error to be sent to an admin if the template throws any.
Adding a part of the code with try catch block(kindly see the first two lines which are not getting highlighted in the code, its :