fix: align user send mail behavior

This commit is contained in:
dreamhunter2333
2026-08-23 21:20:29 +08:00
parent 9109612322
commit 6800dfed3f
3 changed files with 49 additions and 2 deletions
+1 -2
View File
@@ -60,13 +60,12 @@ const send = async (c: Context<HonoCustomType>): Promise<Response> => {
if (address instanceof Response) {
return address;
}
const msgs = i18n.getMessagesbyContext(c);
try {
const reqJson = await c.req.json();
await sendMail(c, address, reqJson);
} catch (error) {
console.error("Failed to send user mail", error);
return c.text(msgs.OperationFailedMsg, 500);
return c.text(`Failed to send mail ${(error as Error).message}`, 400);
}
return c.json({ status: "ok" });
}