Module: Mojito::Helpers::ExceptionHandling::ClassMethods

Defined in:
lib/mojito/helpers/exception_handling.rb

Instance Method Summary collapse

Instance Method Details

#error_handlersObject



64
65
66
# File 'lib/mojito/helpers/exception_handling.rb', line 64

def error_handlers
	@__error_handlers ||= {}
end

#on_error(type, &block) ⇒ Object



55
56
57
58
59
60
61
62
# File 'lib/mojito/helpers/exception_handling.rb', line 55

def on_error(type, &block)
	case type
	when Symbol, Integer
		error_handlers[Mojito::STATUS[type].code] = block
	when Class
		error_handlers[type] = block
	end
end