code: function registerErrorHandlers (logContext, force) {
    if (!force && isInTestMode()) {
      return
    }
    clearLambdaExceptionHandlers()
    logContext.globalErrorHandler = (err, promise) => {
      if (promise) {
        logContext.logger.error('unhandled rejection (this should never happen!)', err.stack)
      } else {
        logContext.logger.error('uncaught exception (this should never happen!)', err.stack)
      }
      process.exit(1)
    }
    process.on('uncaughtException', logContext.globalErrorHandler)
    process.on('unhandledRejection', logContext.globalErrorHandler)
  }
docs: Error Handling