// Handle both user-initiated (SIGINT) and normal termination. process.on( 'SIGINT', function () { handleExit(); process.exit(); } );
errorTypes.map(type => { process.on(type, async () => { try { console.log(`process.on ${type}`) await producer.disconnect() process.exit(0) } catch (_) { process.exit(1) } }) })
// Handle uncaught things _.forEach(['unhandledRejection', 'uncaughtException'], exception => { process.on(exception, error => this.handleError(error, lando.error, this.argv().verbose, lando)); });
process.on('unhandledRejection', async err => { console.error('Unhandled rejection', err); try { await new Promise(resolve => Raven.captureException(err, resolve)); } catch (err) { console.error('Raven error', err); } finally { process.exit(1); } });
// end message process.on('exit', () => console.info(`Successfully created "${outFileName}" files in each directory within ${rootPath}`) );
// Kill server on exit. process.on('SIGINT', () => { process.exit(1); });
errorTypes.map(type => { process.on(type, async e => { try { console.log(`process.on ${type}`) console.error(e) await admin.disconnect() process.exit(0) } catch (_) { process.exit(1) } }) })
// Makes the script crash on unhandled rejections instead of silently // ignoring them. In the future, promise rejections that are not handled will // terminate the Node.js process with a non-zero exit code. process.on('unhandledRejection', err => { throw err; });
// Makes the script crash on unhandled rejections instead of silently // ignoring them. In the future, promise rejections that are not handled will // terminate the Node.js process with a non-zero exit code. process.on('unhandledRejection', err => { throw err; });
// Makes the script crash on unhandled rejections instead of silently // ignoring them. In the future, promise rejections that are not handled will // terminate the Node.js process with a non-zero exit code. process.on('unhandledRejection', err => { throw err; });
// Makes the script crash on unhandled rejections instead of silently // ignoring them. In the future, promise rejections that are not handled will // terminate the Node.js process with a non-zero exit code. process.on('unhandledRejection', err => { throw err; });
// Makes the script crash on unhandled rejections instead of silently // ignoring them. In the future, promise rejections that are not handled will // terminate the Node.js process with a non-zero exit code. process.on('unhandledRejection', err => { throw err; });
// Makes the script crash on unhandled rejections instead of silently // ignoring them. In the future, promise rejections that are not handled will // terminate the Node.js process with a non-zero exit code. process.on('unhandledRejection', err => { throw err; });
errorTypes.map(type => { process.on(type, async e => { try { console.log(`process.on ${type}`) console.error(e) await consumer.disconnect() process.exit(0) } catch (_) { process.exit(1) } }) })
process.on('uncaughtException', async err => { console.error('Uncaught exception', err); try { await new Promise(resolve => Raven.captureException(err, resolve)); } catch (err) { console.error('Raven error', err); } finally { process.exit(1); } });