refs #5772 smtp.send() error throw flow fix
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
8c0e8e9e12
commit
c9f11830a2
|
@ -20,14 +20,18 @@ module.exports = {
|
|||
options.to = config.app.senderEmail;
|
||||
}
|
||||
|
||||
let res;
|
||||
let error;
|
||||
return this.transporter.sendMail(options).catch(err => {
|
||||
try {
|
||||
res = await this.transporter.sendMail(options);
|
||||
} catch (err) {
|
||||
error = err;
|
||||
|
||||
throw err;
|
||||
}).finally(async() => {
|
||||
} finally {
|
||||
await this.mailLog(options, error);
|
||||
});
|
||||
}
|
||||
|
||||
return res;
|
||||
},
|
||||
|
||||
async mailLog(options, error) {
|
||||
|
|
Loading…
Reference in New Issue