You are missing any error handling in the call to youtubeDlExec
. It returns a Promise object, so you need to define a catch
function:
youtubeDlExec(msg.payload, {dumpSingleJson: true}).then(output => {
msg.payload = output;
clearTimeout(myTimeout);
node.send(msg);
node.done();
}).catch(err => {
// An error has been returned by the Promise.
// Do something with it...
});