Q.allSettled returning unhandled rejection promises
julimen5ml opened this issue · 3 comments
Hi! i have been using Q for a long time and now im having this error
const promises = vulnerabilities.map(vuln => database.registerVuln(vuln));
return q.allSettled(promises)
.then((vulns) => {
return list;
});
and registervuln is
function registerVuln(vuln) {
return new Promise((resolve, reject) => {
return reject('rejected value');
});
}
But im getting
(node:525) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): rejected value (node:525) [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.
every where
any solution? am i using allsettled fine?
Q does not emit this warning - native promises do. The error is in another place - either run it in Node.js 10 (better warnings) or with --trace-warnings
to get a proper stack trace.
already solve this!
Please improve the documentation
Thank you!
The documentation - Node's or Q's?