From 14218d9eab129f08c8a0e9bdebba0fc878e47123 Mon Sep 17 00:00:00 2001 From: Michael Kim Date: Sat, 30 Mar 2024 03:01:45 +0900 Subject: [PATCH] [Relay] Fix error message --- packages/relay/src/routers/LedgerRouter.ts | 8 ++++---- packages/relay/src/utils/Errors.ts | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/relay/src/routers/LedgerRouter.ts b/packages/relay/src/routers/LedgerRouter.ts index 1a029775..eab4491f 100644 --- a/packages/relay/src/routers/LedgerRouter.ts +++ b/packages/relay/src/routers/LedgerRouter.ts @@ -403,12 +403,12 @@ export class LedgerRouter { try { const number = this.phoneUtil.parseAndKeepRawInput(phone, "ZZ"); if (!this.phoneUtil.isValidNumber(number)) { - return res.status(200).json(ResponseMessage.getErrorMessage("2003")); + return res.status(200).json(ResponseMessage.getErrorMessage("2007")); } else { phone = this.phoneUtil.format(number, PhoneNumberFormat.INTERNATIONAL); } } catch (error) { - return res.status(200).json(ResponseMessage.getErrorMessage("2003")); + return res.status(200).json(ResponseMessage.getErrorMessage("2007")); } const phoneHash: string = ContractUtils.getPhoneHash(phone); @@ -543,12 +543,12 @@ export class LedgerRouter { try { const number = this.phoneUtil.parseAndKeepRawInput(phone, "ZZ"); if (!this.phoneUtil.isValidNumber(number)) { - return res.status(200).json(ResponseMessage.getErrorMessage("2003")); + return res.status(200).json(ResponseMessage.getErrorMessage("2007")); } else { phone = this.phoneUtil.format(number, PhoneNumberFormat.INTERNATIONAL); } } catch (error) { - return res.status(200).json(ResponseMessage.getErrorMessage("2003")); + return res.status(200).json(ResponseMessage.getErrorMessage("2007")); } const phoneHash: string = ContractUtils.getPhoneHash(phone); diff --git a/packages/relay/src/utils/Errors.ts b/packages/relay/src/utils/Errors.ts index c54f4b6a..10d1a0ca 100644 --- a/packages/relay/src/utils/Errors.ts +++ b/packages/relay/src/utils/Errors.ts @@ -58,7 +58,8 @@ export class ResponseMessage { ["2003", "The payment ID is not exist"], ["2004", "Temporary address that does not exist"], ["2005", "Mobile notification not allowed"], - ["2006", "Mobile notification not allowed"], + ["2006", "Can not found delegator"], + ["2007", "The phone number format is invalid."], ["2020", "The status code for this payment cannot be approved"], ["2022", "The status code for this payment cannot be cancel"], ["2024", "The status code for this payment cannot process closing"],