Press "Enter" to skip to content

Richy's Random Ramblings

Bookmarks from PinBoard May 27, 2017

Bookmarks I’ve added on PinBoard.in recently

Digest powered by RSS Digest

Bookmarks from PinBoard May 20, 2017

Bookmarks I’ve added on PinBoard.in recently

Digest powered by RSS Digest

Bookmarks from PinBoard May 13, 2017

Bookmarks I’ve added on PinBoard.in recently

Digest powered by RSS Digest

NodeJS : UnhandledPromiseRejection handling

Are you programming Node JS Javascript and reached the dreaded:

(node:1984) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): xxxxx
(node:1984) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

but can’t figure out where the Promise is in NodeJS which is causing this? Just add the following bit of code near the top of your code (after the requires if used) which might help:

process.on('unhandledRejection', function(reason,promise) {
console.log('unhandledRejection', reason);
});

Bookmarks from PinBoard May 6, 2017

Bookmarks I’ve added on PinBoard.in recently

Digest powered by RSS Digest