Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Catch invalid param error too
Browse files Browse the repository at this point in the history
  • Loading branch information
dbkr committed Aug 19, 2024
1 parent 9efe162 commit 1c7e27d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/AddThreepid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ export default class AddThreepid {
throw new UserFriendlyError("settings|general|msisdn_in_use", { cause: err });
} else if (err instanceof MatrixError && err.errcode === "M_THREEPID_MEDIUM_NOT_SUPPORTED") {
throw new UserFriendlyError("settings|general|msisdn_adding_unsupported_by_hs", { cause: err });
} else if (err instanceof MatrixError && err.errcode === "M_INVALID_PARAM") {
throw new UserFriendlyError("settings|general|invalid_phone_number", { cause: err });
}
// Otherwise, just blurt out the same error
throw err;
Expand Down
1 change: 1 addition & 0 deletions src/i18n/strings/en_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -2533,6 +2533,7 @@
"error_share_msisdn_discovery": "Unable to share phone number",
"identity_server_no_token": "No identity access token found",
"identity_server_not_set": "Identity server not set",
"invalid_phone_number": "The phone number supplied does not appear to be valid.",
"language_section": "Language",
"msisdn_adding_unsupported_by_hs": "This homeserver does not support adding phone numbers to your account.",
"msisdn_in_use": "This phone number is already in use",
Expand Down

0 comments on commit 1c7e27d

Please sign in to comment.