Skip to content

Commit

Permalink
Errors with recordings no longer cause the page to 500 (#849)
Browse files Browse the repository at this point in the history
  • Loading branch information
farhatahmad authored and jfederico committed Nov 1, 2019
1 parent e61946a commit da80fb5
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
14 changes: 13 additions & 1 deletion app/views/admins/components/_recordings.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,20 @@
</td>
</tr>
<% else %>
<% failed_recordings = 0 %>
<% @recordings.each do |recording| %>
<%= render "admins/components/server_recording_row", recording: recording %>
<% begin %>
<%= render "admins/components/server_recording_row", recording: recording %>
<% rescue => e %>
<% logger.error "Error retrieving recording #{recording[:meetingID]}: #{e} -> #{e.backtrace[0]}" %>
<% failed_recordings += 1 %>
<% end %>
<% end %>
<% if failed_recordings > 0 %>
<div class="alert alert-danger alert-dismissible text-center mb-0">
<%= t("recording.error", count: failed_recordings) %>
</div>
<% end %>
<% end %>
</tbody>
Expand Down
20 changes: 16 additions & 4 deletions app/views/shared/_sessions.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,25 @@
</td>
</tr>
<% else %>
<% failed_recordings = 0 %>
<% recordings.each do |recording| %>
<% if only_public %>
<%= render "shared/components/public_recording_row", recording: recording %>
<% else %>
<%= render "shared/components/recording_row", recording: recording %>
<% begin %>
<% if only_public %>
<%= render "shared/components/public_recording_row", recording: recording %>
<% else %>
<%= render "shared/components/recording_row", recording: recording %>
<% end %>
<% rescue => e %>
<% logger.error "Error retrieving recording #{recording[:meetingID]}: #{e} -> #{e.backtrace[0]}" %>
<% failed_recordings += 1 %>
<% end %>
<% end %>
<% if failed_recordings > 0 %>
<div class="alert alert-danger alert-dismissible text-center mb-0">
<%= t("recording.error", count: failed_recordings) %>
</div>
<% end %>
<% end %>
</tbody>
</table>
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ en:
recording:
all_recordings: All Recordings
email: Email Recording
error: There was an error retrieving %{count} recording(s)
no_recordings: This room has no %{inject}recordings.
no_user_recordings: You currently have no recordings.
no_matched_recordings: No %{inject} recordings match your search.
Expand Down

0 comments on commit da80fb5

Please sign in to comment.