'use strict';

const app = require('ampersand-app');

/**
 * **Handle** unhandled rejections.
 *
 * @todo This prevents program shutdown on unhandled rejections, which equate to
 * unknown program state. Drop this and use
 * app/common/utils/log-unhandled-error.js once
 * {@link https://github.com/electron/electron/issues/6113} is closed.
 *
 * {@link https://nodejs.org/api/process.html#process_event_unhandledrejection}
 */

process.on('unhandledRejection', (reason, p) => {
  app.logger.error('Unhandled rejection at: Promise ', p, ' reason: ', r);
});

'use strict';

const app = require('ampersand-app');

/**
 * **Handle** unhandled rejections.
 *
 * @todo This prevents program shutdown on unhandled rejections, which equate to
 * unknown program state. Drop this and use
 * app/common/utils/log-unhandled-error.js once
 * {@link https://github.com/electron/electron/issues/6113} is closed.
 *
 * {@link https://nodejs.org/api/process.html#process_event_unhandledrejection}
 */

process.on('unhandledRejection', (reason, p) => {
  app.logger.error('Unhandled rejection at: Promise ', p, ' reason: ', reason);
});

Fix unhandled rejection handler param name.
Fix unhandled rejection handler param name.
