Я не понимаю ... Это я или это ошибка в узле?
Это нормально, как и ожидалось:
const a = new Promise((resolve, reject) => {
setTimeout(() => reject('timeout'), 1000);
});
a.catch(console.log);
И это выдает предупреждение:
const a = new Promise((resolve, reject) => {
setTimeout(() => reject('timeout'), 1000);
});
a.then(console.log);
a.catch(console.log);
Я получаю
timeout
(node:40463) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): timeout
(node:40463) [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.