Errors with recordings no longer cause the page to 500 (#849)

This commit is contained in:
Ahmad Farhat 2019-11-01 14:37:38 -04:00 committed by Jesus Federico
parent e61946a0f4
commit da80fb55c7
3 changed files with 30 additions and 5 deletions

View File

@ -75,8 +75,20 @@
</td> </td>
</tr> </tr>
<% else %> <% else %>
<% failed_recordings = 0 %>
<% @recordings.each do |recording| %> <% @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 %>
<% end %> <% end %>
</tbody> </tbody>

View File

@ -91,13 +91,25 @@
</td> </td>
</tr> </tr>
<% else %> <% else %>
<% failed_recordings = 0 %>
<% recordings.each do |recording| %> <% recordings.each do |recording| %>
<% if only_public %> <% begin %>
<%= render "shared/components/public_recording_row", recording: recording %> <% if only_public %>
<% else %> <%= render "shared/components/public_recording_row", recording: recording %>
<%= render "shared/components/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 %>
<% 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 %> <% end %>
</tbody> </tbody>
</table> </table>

View File

@ -365,6 +365,7 @@ en:
recording: recording:
all_recordings: All Recordings all_recordings: All Recordings
email: Email Recording email: Email Recording
error: There was an error retrieving %{count} recording(s)
no_recordings: This room has no %{inject}recordings. no_recordings: This room has no %{inject}recordings.
no_user_recordings: You currently have no recordings. no_user_recordings: You currently have no recordings.
no_matched_recordings: No %{inject} recordings match your search. no_matched_recordings: No %{inject} recordings match your search.