@@ -2,6 +2,7 @@ import { NextFunction, Request, RequestHandler, Response } from 'express';
2
2
import { EmptyResponseDto , SentryWebhookData } from '@/types' ;
3
3
import logger from '@/configs/logger.config' ;
4
4
import { sendSlackMessage } from '@/modules/slack/slack.notifier' ;
5
+ import { BadRequestError } from '@/exception' ;
5
6
6
7
export class WebhookController {
7
8
private readonly STATUS_EMOJI = {
@@ -17,7 +18,7 @@ export class WebhookController {
17
18
) : Promise < void > => {
18
19
try {
19
20
if ( req . body ?. action !== "created" ) {
20
- const response = new EmptyResponseDto ( true , 'Sentry 웹훅 처리에 실패했습니다' , { } , null ) ;
21
+ const response = new BadRequestError ( 'Sentry 웹훅 처리에 실패했습니다' ) ;
21
22
res . status ( 400 ) . json ( response ) ;
22
23
return ;
23
24
}
@@ -38,7 +39,7 @@ export class WebhookController {
38
39
private formatSentryMessage ( sentryData : SentryWebhookData ) : string {
39
40
const { data : { issue } } = sentryData ;
40
41
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 웹훅 처리에 실패했습니다 ' ) ;
42
43
43
44
const { status, title : issueTitle , culprit, permalink, id } = issue ;
44
45
const statusEmoji = this . STATUS_EMOJI [ status as keyof typeof this . STATUS_EMOJI ] ;
0 commit comments