Module: RubyAPI::ErrorHandler
- Included in:
- App
- Defined in:
- lib/rubyapi/error_handler.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.extended(base) ⇒ Object
7 8 9 |
# File 'lib/rubyapi/error_handler.rb', line 7 def self.extended(base) base.instance_variable_set(:@error_handlers, {}) end |
.included(base) ⇒ Object
3 4 5 |
# File 'lib/rubyapi/error_handler.rb', line 3 def self.included(base) base.instance_variable_set(:@error_handlers, {}) end |
Instance Method Details
#error_handlers ⇒ Object
16 17 18 |
# File 'lib/rubyapi/error_handler.rb', line 16 def error_handlers @error_handlers || {} end |
#rescue_from(exception_class, status: 500) ⇒ Object
11 12 13 14 |
# File 'lib/rubyapi/error_handler.rb', line 11 def rescue_from(exception_class, status: 500) @error_handlers ||= {} @error_handlers[exception_class] = status end |