[주문결제] return Detail Code 추가

This commit is contained in:
hyunwoo93.cha
2024-11-13 10:52:44 +09:00
parent 8311fff5a4
commit 4c8da84f19
5 changed files with 50 additions and 10 deletions

View File

@@ -528,12 +528,12 @@ export const getTimeDifferenceByMilliseconds = (
return timeDifference > threshold;
};
export const getErrorMessage = (errorCode, retMsg) => {
export const getErrorMessage = (errorCode, retMsg, retDetailCode) => {
const group = ERROR_MESSAGES_GROUPS.find((group) =>
group.codes.includes(Number(errorCode))
);
const errorPrefix = `[${errorCode}] `;
const errorPrefix = retDetailCode ? `[${retDetailCode}] ` : `[${errorCode}] `;
if (group) {
return errorPrefix + group.message;