Class PaySyncApiException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AuthenticationException, ConflictException, InvalidRequestException, NotFoundException, PermissionDeniedException, RateLimitException, ServerException

public class PaySyncApiException extends PaySyncException
PaySync API가 오류를 응답했습니다. code()로 오류를 구분하세요. 자주 쓰는 값은 ErrorCode에 있습니다.
try {
    client.invoices().create(params);
} catch (ConflictException e) {
    if (ErrorCode.INVOICE_ALREADY_EXISTS.equals(e.code())) {
        String existingId = e.duplicateInvoice().invoiceId();
    }
}
See Also:
  • Constructor Details

    • PaySyncApiException

      public PaySyncApiException(int httpStatus, @Nullable String code, @Nullable org.json.JSONObject data, String body)
  • Method Details

    • of

      public static PaySyncApiException of(int httpStatus, @Nullable String code, @Nullable org.json.JSONObject data, String body)
      HTTP 상태에 맞는 예외를 만듭니다.
    • httpStatus

      public int httpStatus()
      HTTP 상태 코드입니다.
    • code

      public @Nullable String code()
      오류 코드입니다. (예: "220010") 응답이 JSON이 아니면 null입니다.
    • data

      public @Nullable org.json.JSONObject data()
      오류 응답의 data입니다. 없으면 null입니다.
    • body

      public String body()
      응답 본문입니다.
    • duplicateInvoice

      public @Nullable PaySyncApiException.DuplicateInvoice duplicateInvoice()
      220010일 때 이미 있는 결제 대기 주문입니다. 다른 오류면 null입니다.
    • existingCashReceiptId

      public @Nullable String existingCashReceiptId()
      240012일 때 주문에 이미 발급한 현금영수증 ID입니다. 다른 오류면 null입니다.
    • cancelBlocked

      public @Nullable PaySyncApiException.CancelBlocked cancelBlocked()
      240006일 때 현금영수증을 취소할 수 없는 이유입니다. 다른 오류면 null입니다.
    • failedCashReceipt

      public @Nullable CashReceipt failedCashReceipt()
      240008일 때 발급에 실패한 현금영수증입니다. 다른 오류면 null입니다.
    • providerError

      public @Nullable PaySyncApiException.ProviderError providerError()
      240009일 때 팝빌 오류입니다. 다른 오류면 null입니다.