module Granite::Action::ExceptionsHandling

Private Instance Methods

handle_exception(e) click to toggle source
# File lib/granite/action/exceptions_handling.rb, line 31
def handle_exception(e)
  klass = e.class.ancestors.detect do |ancestor|
    ancestor <= Exception && _exception_handlers[ancestor]
  end
  instance_exec(e, &_exception_handlers[klass]) if klass
end
handled_exceptions() click to toggle source
# File lib/granite/action/exceptions_handling.rb, line 27
def handled_exceptions
  _exception_handlers.keys
end