Skip to content

Tag: es6-promise

Javascript Promises catch block not working?

I am trying to make a function that calls promises synchronously so that if any of them return false the execution stops and returns the reject object with the reason why the promise returned false. Right now I am getting the error: UnhandledPromiseRejection: This error originated either by throwing inside of…

Alternative for Promise.allSettled

I am currently using Promise.allSettled to wait for all my promises to finish(irrespective of whether they resolve or get rejected). Since my project is compliant to Node v12.3.1 I am unable to use this? What other simple alternatives can I use. Sample code: Note: Promise.allSettled is available from Node ver…