fix: Toss 결제 승인 실패 응답의 error code를 도메인 에러로 매핑 - #422
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.
✅ PR 설명
Toss가 승인 실패 시 응답 body에 {code, message}를 주는데도, 기존 코드는 4xx 예외를 catch(Exception)으로 잡아 모두 PAYMENT_VERIFICATION_FAILED로 뭉개고 실제 원인을 버렸습니다.
이에 운영에서 실패 원인을 알 수 없고, 사용자에게도 항상 동일한 에러가 나갔습니다.
그래서 Toss 실패 응답의 code를 파싱해 도메인 에러로 매핑하고, 매핑되지 않는 코드도 실제 code/message를 로그로 남기도록 했습니다.
🏗 작업 내용
📸 테스트 결과 (선택)
🔗 관련 이슈 (선택)
🚨 참고 사항 (선택)