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?