Skip to content

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

@marinesnow34

Description

@marinesnow34
  • 에러를 동일하게 처리하고 있음
  • 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);
}

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions