A platform for community discussion. Free, open, simple.
FIX: `rescue_from` doesn't bubble up.
Guo Xiang Tan26c7fa2c296a
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rbindex abde04d24be..2f2b8a9694f 100644--- a/app/controllers/application_controller.rb+++ b/app/controllers/application_controller.rb@@ -124,7 +124,7 @@ class ApplicationController < ActionController::Baserescue_from PG::ReadOnlySqlTransaction do |e|Discourse.received_postgres_readonly!Rails.logger.error("#{e.class} #{e.message}: #{e.backtrace.join("\n")}")- raise Discourse::ReadOnly+ rescue_with_handler(Discourse::ReadOnly.new) || raiseendrescue_from ActionController::ParameterMissing do |e|@@ -212,7 +212,9 @@ class ApplicationController < ActionController::Baseendrescue_from Discourse::ReadOnly do- render_json_error I18n.t('read_only_mode_enabled'), type: :read_only, status: 503+ unless response_body+ render_json_error I18n.t('read_only_mode_enabled'), type: :read_only, status: 503+ endenddef redirect_with_client_support(url, options)