Merge pull request #4035 from tgxworld/dont_return_500_when_plugin_is_disabled

Return 404 instead 500 when plugin is disabled.
This commit is contained in:
Sam 2016-02-27 16:55:50 +11:00
commit 610954ecce
1 changed files with 3 additions and 3 deletions

View File

@ -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)