A plugin API to catch exceptions

This commit is contained in:
Robin Ward 2017-10-02 12:04:59 -04:00
parent 47e79570cc
commit 823936ca9c
1 changed files with 6 additions and 0 deletions

View File

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