Skip to content

Commit

Permalink
show a specific error message when a required server type is unavaila…
Browse files Browse the repository at this point in the history
  • Loading branch information
Ithanil committed Jun 25, 2024
1 parent f3037a4 commit c4175d6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/assets/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@
},
"error": {
"problem_completing_action": "The action can't be completed. \n Please try again.",
"server_type_unavailable": "The required server type is unavailable. Please select a different type in the room settings.",
"file_type_not_supported": "The file type is not supported.",
"file_size_too_large": "The file size is too large.",
"file_upload_error": "The file can't be uploaded.",
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/v1/meetings_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def start
begin
MeetingStarter.new(room: @room, base_url: request.base_url, current_user:, provider: current_provider).call
rescue BigBlueButton::BigBlueButtonException => e
return render_error status: :bad_request unless e.key == 'idNotUnique'
return render_error status: :bad_request, errors: e.key unless e.key == 'idNotUnique'
end

render_data data: BigBlueButtonApi.new(provider: current_provider).join_meeting(
Expand Down
8 changes: 6 additions & 2 deletions app/javascript/hooks/mutations/rooms/useStartMeeting.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@ export default function useStartMeeting(friendlyId) {
onSuccess: (joinUrl) => {
window.location.href = joinUrl;
},
onError: () => {
toast.error(t('toast.error.problem_completing_action'));
onError: (error) => {
if (error.response.data.errors !== 'serverTagUnavailable') {
toast.error(t('toast.error.problem_completing_action'));
} else {
toast.error(t('toast.error.server_type_unavailable'));
}
},
},
);
Expand Down

0 comments on commit c4175d6

Please sign in to comment.