From 190fc57f5eccd3f94b3b85d0d925fddbea6d8199 Mon Sep 17 00:00:00 2001
From: farhatahmad <35435341+farhatahmad@users.noreply.github.com>
Date: Thu, 23 May 2019 09:36:28 -0400
Subject: [PATCH] Added a BigBlueButton error page (#548)
---
app/controllers/application_controller.rb | 8 ++++++++
app/views/errors/bigbluebutton_error.html.erb | 20 +++++++++++++++++++
config/locales/en.yml | 5 ++++-
.../application_controller_spec.rb | 15 ++++++++++++--
4 files changed, 45 insertions(+), 3 deletions(-)
create mode 100644 app/views/errors/bigbluebutton_error.html.erb
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index bbd6f29e..95bb979b 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -29,6 +29,9 @@ class ApplicationController < ActionController::Base
before_action :set_user_domain
before_action :check_user_role
+ # Manually handle BigBlueButton errors
+ rescue_from BigBlueButton::BigBlueButtonException, with: :handle_bigbluebutton_error
+
# Force SSL for loadbalancer configurations.
before_action :redirect_to_https
@@ -147,4 +150,9 @@ class ApplicationController < ActionController::Base
end
end
helper_method :check_user_role
+
+ # Manually Handle BigBlueButton errors
+ def handle_bigbluebutton_error
+ render "errors/bigbluebutton_error"
+ end
end
diff --git a/app/views/errors/bigbluebutton_error.html.erb b/app/views/errors/bigbluebutton_error.html.erb
new file mode 100644
index 00000000..b1e41b6b
--- /dev/null
+++ b/app/views/errors/bigbluebutton_error.html.erb
@@ -0,0 +1,20 @@
+<%
+# BigBlueButton open source conferencing system - http://www.bigbluebutton.org/.
+# Copyright (c) 2018 BigBlueButton Inc. and by respective authors (see below).
+# This program is free software; you can redistribute it and/or modify it under the
+# terms of the GNU Lesser General Public License as published by the Free Software
+# Foundation; either version 3.0 of the License, or (at your option) any later
+# version.
+#
+# BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public License along
+# with BigBlueButton; if not, see
<%= I18n.t("errors.bigbluebutton.help", doc_link: "http://docs.bigbluebutton.org/greenlight/gl-install.html#setting-bigbluebutton-credentials").html_safe %>
+