Node global error handling

Date: 2019-11-25
process.on('unhandledRejection', (reason, promise) => {
	console.log('Unhandled Rejection at:', promise, 'reason:', reason);
});

process.on('uncaughtException', (err, origin) => {
	console.log(
		process.stderr.fd,
		`Caught exception: ${err}\n` +
		`Exception origin: ${origin}`
	);
});
29290cookie-checkNode global error handling