refactor: add error log for tencent alarm
This commit is contained in:
parent
e9c64c57e7
commit
af4792024f
@ -6,6 +6,7 @@ import { OpenApiMeta } from 'trpc-openapi';
|
|||||||
import { OPENAPI_TAG } from '../../../utils/const.js';
|
import { OPENAPI_TAG } from '../../../utils/const.js';
|
||||||
import { createFeedEvent } from '../../../model/feed/event.js';
|
import { createFeedEvent } from '../../../model/feed/event.js';
|
||||||
import { tencentCloudAlarmSchema } from '../../../model/_schema/feed.js';
|
import { tencentCloudAlarmSchema } from '../../../model/_schema/feed.js';
|
||||||
|
import { logger } from '../../../utils/logger.js';
|
||||||
|
|
||||||
export const feedIntegrationRouter = router({
|
export const feedIntegrationRouter = router({
|
||||||
github: publicProcedure
|
github: publicProcedure
|
||||||
@ -166,7 +167,8 @@ export const feedIntegrationRouter = router({
|
|||||||
|
|
||||||
const res = tencentCloudAlarmSchema.safeParse(data);
|
const res = tencentCloudAlarmSchema.safeParse(data);
|
||||||
if (!res.success) {
|
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;
|
const alarm = res.data;
|
||||||
|
Loading…
Reference in New Issue
Block a user