Posts

Showing posts with the label promise

node 8.6 javascript promises: UnhandledPromiseRejectionWarning

node 8.6 javascript promises: UnhandledPromiseRejectionWarning I am having an error: (node:6186) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): threep (node:6186) [DEP0018] 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. -------- ones ========= two CaughtCathchError threep (node:6186) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 1) I am consuming my 3 promise functions in nested order. p1,p2,p3- are my promise functions as shown below. i tried adding promise reject in all p1,p2,p3 functions as well but its still the same enter code here var p1 = new Promise(function (resolve, reject) { setTimeout(function () { // resolve('ones') resolve('ones') }, 9000) }) var p2 = new Promise(function (resolve, reject) { setTimeout(function...