How to find which promises are unhandled in Node.js UnhandledPromiseRejectionWarning?

listen unhandledRejection event of process.

process.on('unhandledRejection', (reason, p) => {
  console.log('Unhandled Rejection at: Promise', p, 'reason:', reason);
  // application specific logging, throwing an error, or other logic here
});

Leave a Comment