diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index b36e02ccd84..ea15af17eea 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -94,7 +94,9 @@ class ApplicationController < ActionController::Base end end - rescue_from Discourse::NotFound do + class PluginDisabled < StandardError; end + + rescue_from Discourse::NotFound, PluginDisabled do rescue_discourse_actions(:not_found, 404) end @@ -120,8 +122,6 @@ class ApplicationController < ActionController::Base end end - class PluginDisabled < StandardError; end - # If a controller requires a plugin, it will raise an exception if that plugin is # disabled. This allows plugins to be disabled programatically. def self.requires_plugin(plugin_name)