Friday, 28 May 2021

SuiteScript Error - Catch(e) - e undefined

I have a simple try/catch block in my SuiteScript:

try
{
    var csvFile = file.create({name : outputFileName,
                               contents : header,
                               folder : 123,
                               fileType : 'xy'});
}
catch (e)
{
 log.debug({
    title : 'Error',
    details : e.description
  });
}

(note that in the above the fileType of 'xy' is intentional, to force the error).

The problem is that when I get to the catch block, 'e' is always undefined. That's how it's logged and that's what the debugger shows. I don't know how that can even happen.

What could be causing this?



from SuiteScript Error - Catch(e) - e undefined

No comments:

Post a Comment