Closed Eomm closed 3 months ago
The statement seems not correct (node v20.x):
This promise could be ignored as it will not lead to a 'unhandledRejection'.
'unhandledRejection'
const queue = require('fastq').promise(worker, 1); async function worker (arg) { throw new Error('app error'); } process.on('unhandledRejection', (err) => { console.error({ unhandledRejection: err }); }); async function run () { const result = await queue.push(42); console.log('the result is', result); } run();
Output:
{ unhandledRejection: Error: app error.... }
Have you tried not awaiting it at all?
Ok, it was my run that triggers the unhandled exception 👍🏼
run
The statement seems not correct (node v20.x):
Output: