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:
commit
610954ecce
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue