Fix UnhandledPromiseRejectionWarnings in Node.js

These were introduced in 9bdeaa9 by `await`ing Promises later than
they're created.
This commit is contained in:
Daniel Huigens 2020-01-24 18:05:50 +01:00
parent 382c05df6f
commit e8ee70b2a8
2 changed files with 2 additions and 0 deletions

View File

@ -313,6 +313,7 @@ function dearmor(input) {
}));
data = stream.transformPair(data, async (readable, writable) => {
const checksumVerified = stream.readToEnd(getCheckSum(stream.passiveClone(readable)));
checksumVerified.catch(() => {});
await stream.pipe(readable, writable, {
preventClose: true
});

View File

@ -586,6 +586,7 @@ Message.prototype.verify = async function(keys, date = new Date(), streaming) {
});
onePassSig.signatureData = stream.fromAsync(async () => (await onePassSig.correspondingSig).signatureData);
onePassSig.hashed = stream.readToEnd(await onePassSig.hash(onePassSig.signatureType, literalDataList[0], undefined, false, streaming));
onePassSig.hashed.catch(() => {});
}));
msg.packets.stream = stream.transformPair(msg.packets.stream, async (readable, writable) => {
const reader = stream.getReader(readable);