Skip to content

Commit

Permalink
[Relay] Fix error message
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelKim20 committed Mar 29, 2024
1 parent 9101120 commit 14218d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions packages/relay/src/routers/LedgerRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down
3 changes: 2 additions & 1 deletion packages/relay/src/utils/Errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down

0 comments on commit 14218d9

Please sign in to comment.