2

While debugging, I would check the Execution Log on NetSuite.

I uses log.debug('title', 'message') format to show log.

Can the line number which the error happens be also logged?

Thus we can easily know where the error is. Thanks.

skyline
  • 443
  • 9
  • 31

1 Answers1

3

NetSuite Error object contains stack property which can be used to get stack trace.

eg.

try {
  throw error.create({ name: 'ERROR', message: 'ERROR_MESSAGE' });
} catch (ex) {
  log.debug({ title: 'Error Stack', details: ex.stack });
}
Avi
  • 2,014
  • 1
  • 9
  • 21