Today I Learned

hashrocket A Hashrocket project

Show where `UnhandledPromiseRejection`s are at

Cleaning up a test suite and getting a lot of cryptic UnhandledPromiseRejectionWarning:s? Well then this little snippet can save you some time:

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

Credit where credit is due

See More #javascript TILs
Looking for help? At Hashrocket, our JavaScript experts launch scalable, performant apps on the Web, Android and iOS. Contact us and find out how we can help you.