Skip to content

Commit

Permalink
Regression: Add better error messages when call fails (#26134)
Browse files Browse the repository at this point in the history
  • Loading branch information
KevLehman authored Jul 6, 2022
1 parent 43e6b7e commit eb5b81d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 11 additions & 2 deletions apps/meteor/client/providers/CallProvider/CallProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,17 @@ export const CallProvider: FC = ({ children }) => {
startRingback(user);
};

const onCallFailed = (): void => {
openDialModal({ errorMessage: t('Something_went_wrong_try_again_later') });
const onCallFailed = (reason: 'Not Found' | 'Address Incomplete' | string): void => {
switch (reason) {
case 'Not Found':
openDialModal({ errorMessage: t('Dialed_number_doesnt_exist') });
break;
case 'Address Incomplete':
openDialModal({ errorMessage: t('Dialed_number_is_incomplete') });
break;
default:
openDialModal({ errorMessage: t('Something_went_wrong_try_again_later') });
}
};

result.voipClient.onNetworkEvent('connected', onNetworkConnected);
Expand Down
2 changes: 2 additions & 0 deletions apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -1493,6 +1493,8 @@
"Devices": "Devices",
"Devices_Set": "Devices Set",
"Device_settings": "Device Settings",
"Dialed_number_doesnt_exist": "Dialed number doesn't exist",
"Dialed_number_is_incomplete": "Dialed number is not complete",
"Different_Style_For_User_Mentions": "Different style for user mentions",
"Direct": "Direct",
"Direction": "Direction",
Expand Down

0 comments on commit eb5b81d

Please sign in to comment.