Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: Add better error messages when call fails #26134

Merged
merged 1 commit into from
Jul 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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