From af4792024f3adc0b152f101e066f84077c98ecf7 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Sun, 28 Jul 2024 01:08:05 +0800 Subject: [PATCH] refactor: add error log for tencent alarm --- src/server/trpc/routers/feed/integration.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/server/trpc/routers/feed/integration.ts b/src/server/trpc/routers/feed/integration.ts index a4411fc..0919141 100644 --- a/src/server/trpc/routers/feed/integration.ts +++ b/src/server/trpc/routers/feed/integration.ts @@ -6,6 +6,7 @@ import { OpenApiMeta } from 'trpc-openapi'; import { OPENAPI_TAG } from '../../../utils/const.js'; import { createFeedEvent } from '../../../model/feed/event.js'; import { tencentCloudAlarmSchema } from '../../../model/_schema/feed.js'; +import { logger } from '../../../utils/logger.js'; export const feedIntegrationRouter = router({ github: publicProcedure @@ -166,7 +167,8 @@ export const feedIntegrationRouter = router({ const res = tencentCloudAlarmSchema.safeParse(data); if (!res.success) { - throw new Error('Input not valid'); + logger.error('[TencentCloudAlarm] input parse error:', res.error); + throw new Error('Input not valid,' + JSON.stringify(res.error)); } const alarm = res.data;