[SHOPTIME-3662] Checkout 이동 시 "thisProductDoesNotSupportPayment" 팝업 노출
수정 내용: 에러 코드 별 메세지 추가
This commit is contained in:
@@ -6,7 +6,7 @@ import stringReSourceEn from "../../resources/en/strings.json";
|
||||
import stringReSourceGb from "../../resources/gb/strings.json";
|
||||
import stringReSourceRu from "../../resources/ru/strings.json";
|
||||
import { getRicCode } from "../api/apiConfig";
|
||||
import { SECRET_KEY } from "./Config";
|
||||
import { ERROR_MESSAGES_GROUPS, SECRET_KEY } from "./Config";
|
||||
|
||||
let _boundingRectCache = {};
|
||||
const BOUNDING_RECT_IGNORE_TIME = 10;
|
||||
@@ -525,3 +525,16 @@ export const getTimeDifferenceByMilliseconds = (
|
||||
|
||||
return timeDifference > threshold;
|
||||
};
|
||||
|
||||
export const getErrorMessage = (errorCode, retMsg) => {
|
||||
const group = ERROR_MESSAGES_GROUPS.find((group) =>
|
||||
group.codes.includes(Number(errorCode))
|
||||
);
|
||||
if (group) {
|
||||
return group.message;
|
||||
} else if (retMsg) {
|
||||
return retMsg;
|
||||
} else {
|
||||
return "An unknown error occurred. Please try again later.";
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user