@@ -2,6 +2,7 @@ import { NextFunction, Request, RequestHandler, Response } from 'express';
22import { EmptyResponseDto , SentryWebhookData } from '@/types' ;
33import logger from '@/configs/logger.config' ;
44import { sendSlackMessage } from '@/modules/slack/slack.notifier' ;
5+ import { BadRequestError } from '@/exception' ;
56
67export class WebhookController {
78 private readonly STATUS_EMOJI = {
@@ -17,7 +18,7 @@ export class WebhookController {
1718 ) : Promise < void > => {
1819 try {
1920 if ( req . body ?. action !== "created" ) {
20- const response = new EmptyResponseDto ( true , 'Sentry 웹훅 처리에 실패했습니다' , { } , null ) ;
21+ const response = new BadRequestError ( 'Sentry 웹훅 처리에 실패했습니다' ) ;
2122 res . status ( 400 ) . json ( response ) ;
2223 return ;
2324 }
@@ -38,7 +39,7 @@ export class WebhookController {
3839 private formatSentryMessage ( sentryData : SentryWebhookData ) : string {
3940 const { data : { issue } } = sentryData ;
4041
41- if ( ! issue . status || ! issue . title || ! issue . culprit || ! issue . id ) throw new Error ( 'Sentry 웹훅 데이터가 올바르지 않습니다 ' ) ;
42+ if ( ! issue . status || ! issue . title || ! issue . culprit || ! issue . id ) throw new BadRequestError ( 'Sentry 웹훅 처리에 실패했습니다 ' ) ;
4243
4344 const { status, title : issueTitle , culprit, permalink, id } = issue ;
4445 const statusEmoji = this . STATUS_EMOJI [ status as keyof typeof this . STATUS_EMOJI ] ;
0 commit comments