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

@@ -15,6 +15,7 @@ import { PERM, PRIV } from '../model/builtin';
import {
Route, Handler, Types, param,
} from '../service/server';
import * as bus from '../service/bus';
import { isTitle, isContent } from '../lib/validator';
export const typeMapper = {
@@ -165,6 +166,11 @@ class DiscussionCreateHandler extends DiscussionHandler {
else name = _name;
if (highlight) this.checkPerm(PERM.PERM_HIGHLIGHT_DISCUSSION);
if (pin) this.checkPerm(PERM.PERM_PIN_DISCUSSION);
await bus.serial(
'discussion/before-add',
domainId, typeMapper[type], name, this.user._id,
title, content, this.request.ip, highlight, pin,
);
const did = await discussion.add(
domainId, typeMapper[type], name, this.user._id,
title, content, this.request.ip, highlight, pin,