core: add log for send-mail-error

This commit is contained in:
undefined committed 2021-03-07 19:03:58 +08:00
1 parent a81d514b10
commit 72998f643b
4 files changed
+20 -2

No files matched your search

+4
View File
@@ -1,5 +1,8 @@
import nodemailer from 'nodemailer';
import { SendMailError } from '../error';
import { Logger } from '../logger';
const logger = new Logger('mail');
export async function sendMail(to: string, subject: string, text: string, html: string) {
let t: unknown;
@@ -29,6 +32,7 @@ export async function sendMail(to: string, subject: string, text: string, html:
});
});
} catch (e) {
logger.error(e);
throw new SendMailError(to);
}
return t;