mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 09:46:28 +08:00
core: add log for send-mail-error
This commit is contained in:
1 parent
a81d514b10
commit
72998f643b
4 files changed
+20
-2
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user