refs #5772 smtp.send() error throw flow fix
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Juan Ferrer 2023-06-23 20:03:56 +02:00
parent 8c0e8e9e12
commit c9f11830a2
1 changed files with 8 additions and 4 deletions

View File

@ -20,14 +20,18 @@ module.exports = {
options.to = config.app.senderEmail; options.to = config.app.senderEmail;
} }
let res;
let error; let error;
return this.transporter.sendMail(options).catch(err => { try {
res = await this.transporter.sendMail(options);
} catch (err) {
error = err; error = err;
throw err; throw err;
}).finally(async() => { } finally {
await this.mailLog(options, error); await this.mailLog(options, error);
}); }
return res;
}, },
async mailLog(options, error) { async mailLog(options, error) {