diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 8c1d1b29c6..94e87360cc 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -15,6 +15,7 @@ class ApplicationController < ActionController::Base rescue_from Pundit::NotAuthorizedError, with: :not_authorized rescue_from Organizational::UnknownOrganization, with: :not_authorized + rescue_from StandardError, with: :log_and_reraise impersonates :user @@ -134,6 +135,11 @@ def not_authorized redirect_to(root_url) end + def log_and_reraise(error) + Bugsnag.notify(error) + raise error + end + def check_unconfirmed_email_notice(user) notice = "#{user.role} was successfully updated." if user.saved_changes.include?("unconfirmed_email") diff --git a/public/403.html b/public/403.html index 60a47d90eb..09eef6bbaf 100644 --- a/public/403.html +++ b/public/403.html @@ -1,7 +1,7 @@ - We're sorry, but something went wrong (500) + We're sorry, but something went wrong (403)