Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
fix: added ErrorMessage type for sku
Browse files Browse the repository at this point in the history
  • Loading branch information
omerhabib26 committed Feb 20, 2024
1 parent f09bde6 commit b79d967
Showing 1 changed file with 9 additions and 20 deletions.
29 changes: 9 additions & 20 deletions OpenEdXMobile/src/main/java/org/edx/mobile/util/TextUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -207,26 +207,15 @@ public static StringBuilder getFormattedErrorMessage(int requestType, int errorC
if (requestType == 0) {
return body;
}
String endpoint;
switch (requestType) {
case ErrorMessage.ADD_TO_BASKET_CODE:
endpoint = "basket";
break;
case ErrorMessage.CHECKOUT_CODE:
endpoint = "checkout";
break;
case ErrorMessage.EXECUTE_ORDER_CODE:
endpoint = "execute";
break;
case ErrorMessage.PAYMENT_SDK_CODE:
endpoint = "payment";
break;
case ErrorMessage.PRICE_CODE:
endpoint = "price";
break;
default:
endpoint = "unhandledError";
}
String endpoint = switch (requestType) {
case ErrorMessage.ADD_TO_BASKET_CODE -> "basket";
case ErrorMessage.CHECKOUT_CODE -> "checkout";
case ErrorMessage.EXECUTE_ORDER_CODE -> "execute";
case ErrorMessage.PAYMENT_SDK_CODE -> "payment";
case ErrorMessage.PRICE_CODE -> "price";
case ErrorMessage.NO_SKU_CODE -> "sku";
default -> "unhandledError";
};
body.append(String.format("%s", endpoint));
// change the default value to -1 cuz in case of BillingClient return errorCode 0 for price load.
if (errorCode == -1) {
Expand Down

0 comments on commit b79d967

Please sign in to comment.