I have a CodeResource CloudPage that contains only SSJS that is wrapped in one big try/catch, like this:

<script language="javascript" runat="server">
Platform.Load("core", "1.1.1");

try {
<a bunch of ssjs code>
} catch(e) {
Write("An error occurred. ");

Inside the try/catch I'm performing operations like looping through data extension rows, upserting into data extensions, making http requests and parsing responses. There is nothing else on the page. I probably have some faulty data that from time to time ends up crashing the script and I am trying to find out what exactly is happening, but despite the try/catch block all I get on the page is the 500 Internal server error. What could be the cause?

  • 2
    Do you have an orphaned bracket within your SSJS? Also, it might be more helpful to post that section of your solution in order to get a detailed answer. Apr 8, 2020 at 19:55
  • 1
    With Jason on this, most likely a bracket issue. You could try eslint with npmjs.com/package/eslint-config-ssjs (removing the <> tags) which could help detect the issue:)
    – Doug
    Apr 11, 2020 at 10:35


You must log in to answer this question.

Browse other questions tagged .