fix: Slack 서버 에러 알림에서 4xx 비즈니스 예외 제외 - #470
Merged
Merged
Conversation
📊 테스트 커버리지 리포트
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#️⃣ Issue Number
📝 요약(Summary)
ControllerLogAspect가 컨트롤러에서 발생한 모든 예외를 종류 구분 없이 SlackSERVER_ERROR채널로 전송하고 있어, 4xx 비즈니스 예외(BaseException)까지 서버 에러 알림 노이즈로 쌓이던 문제를 수정했습니다.BaseResponseStatus에 이미 정의돼 있었지만 어디서도 호출되지 않던sendSlackNotification(status)(is5xxServerError()기준) 헬퍼를ControllerLogAspect.shouldNotifySlack()에 연결해,BaseException이면서 상태가 4xx인 경우만 알림을 생략하도록 했습니다.BaseException이 아닌 예외(미처리 런타임 예외)와 5xxBaseException은 기존과 동일하게 전송됩니다.💬 공유사항 to 리뷰어
컨트롤러_예외를_슬랙에_알리고_다시_던진다가 404(NOT_FOUND_MENU)로 Slack 알림 발생을 검증하고 있었는데, 이번 변경으로 4xx는 알림 대상에서 빠지므로 해당 테스트를 5xx(INTERNAL_SERVER_ERROR)로 교체하고, 4xx는 알림이 가지 않음을 검증하는 테스트(doesNotNotifySlackFor4xxBusinessException)를 새로 추가했습니다.server.env=prod에서만 실제 Slack 전송이 발생하므로 운영 영향은 다음 배포 이후 실제 알림 채널에서 확인이 필요합니다.✅ PR Checklist
PR이 다음 요구 사항을 충족하는지 확인하세요.