Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

토스 에러 핸들링 구체화 #204

Open
marinesnow34 opened this issue Mar 14, 2024 · 2 comments
Open

토스 에러 핸들링 구체화 #204

marinesnow34 opened this issue Mar 14, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@marinesnow34
Copy link
Member

  • 에러를 동일하게 처리하고 있음
  • API문서를 활용해서 상황별 에러를 구분할 필요가 있음
try {
    return restTemplate.postForObject(TossPaymentConfig.CONFIRM_URL,
        new HttpEntity<>(params, headers),
        TosspaymentDto.class);
} catch (HttpClientErrorException e) {
    return e.getResponseBodyAs(TosspaymentDto.class);
} catch (Exception e) {
    log.error("e.getMessage() = " + e.getMessage());
    throw new BusinessLogicException(ExceptionCode.TOSS_PAYMENT_SUCCESS_FAIL);
}
@marinesnow34 marinesnow34 added the duplicate This issue or pull request already exists label Mar 14, 2024
@marinesnow34 marinesnow34 self-assigned this Mar 14, 2024
@marinesnow34 marinesnow34 added enhancement New feature or request and removed duplicate This issue or pull request already exists labels Mar 14, 2024
@marinesnow34
Copy link
Member Author

#231 이런식으로 적용

@marinesnow34
Copy link
Member Author

토스 에러 만들기 참고

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant