module Granite::Action::ExceptionsHandling::ClassMethods
Public Instance Methods
handle_exception(klass, &block)
click to toggle source
Register default handler for exceptions thrown inside execute_perform! and after_commit methods. @param klass Exception class, could be parent class too [Class] @param block [Block<Exception>] with default behavior for handling specified
type exceptions. First block argument is raised exception instance.
@return [Hash<Class, Proc>] Registered handlers
# File lib/granite/action/exceptions_handling.rb, line 20 def handle_exception(klass, &block) self._exception_handlers = _exception_handlers.merge(klass => block) end