do not use finally

This commit is contained in:
Andris Reinman 2019-11-21 16:23:18 +02:00
parent e7d40d5ce2
commit cf8d8f28cd
No known key found for this signature in database
GPG key ID: 5388A30A31834D83

View file

@ -43,19 +43,19 @@ async function mboxExport(auditHandler, audit) {
setImmediate(() => {
processExport()
.catch(err => {
try {
outputStream.write('\n' + err.message);
} catch (err) {
//ignore
}
})
.finally(() => {
.then(() => {
try {
outputStream.end();
} catch (err) {
// ignore at this point
}
})
.catch(err => {
try {
outputStream.end('\n' + err.message);
} catch (err) {
//ignore
}
});
});