process.on('unhandledRejection', (reason: Error | any, promise: Promise<any>) => { console.log('Unhandled Rejection at:', promise, 'reason:', reason); // Application specific logging, throwing an error, or other logic here });