mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
A plugin API to catch exceptions
This commit is contained in:
@@ -109,6 +109,12 @@ class Plugin::Instance
|
||||
end
|
||||
end
|
||||
|
||||
def rescue_from(exception, &block)
|
||||
reloadable_patch do |plugin|
|
||||
::ApplicationController.rescue_from(exception, &block)
|
||||
end
|
||||
end
|
||||
|
||||
# Extend a class but check that the plugin is enabled
|
||||
# for class methods use `add_class_method`
|
||||
def add_to_class(class_name, attr, &block)
|
||||
|
||||
Reference in New Issue
Block a user