[지라이슈없음] 에러 발생 시 에러코드 + 에러메세지 함께 노출

This commit is contained in:
hyunwoo93.cha
2024-11-12 08:55:54 +09:00
parent 1b6699bf56
commit a0a02144ba

View File

@@ -532,11 +532,14 @@ export const getErrorMessage = (errorCode, retMsg) => {
const group = ERROR_MESSAGES_GROUPS.find((group) =>
group.codes.includes(Number(errorCode))
);
const errorPrefix = `[${errorCode}] `;
if (group) {
return group.message;
return errorPrefix + group.message;
} else if (retMsg) {
return retMsg;
return errorPrefix + retMsg;
} else {
return "An unknown error occurred. Please try again later.";
return errorPrefix + "An unknown error occurred. Please try again later.";
}
};