Class: Exceptional::Catcher
- Inherits:
-
Object
- Object
- Exceptional::Catcher
- Defined in:
- lib/exceptional/catcher.rb
Class Method Summary collapse
- .handle(exception, name = nil) ⇒ Object
- .handle_with_controller(exception, controller = nil, request = nil) ⇒ Object
- .handle_with_rack(exception, environment, request) ⇒ Object
Class Method Details
.handle(exception, name = nil) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/exceptional/catcher.rb', line 18 def handle(exception, name=nil) if Config.should_send_to_api? data = ExceptionData.new(exception, name) Remote.error(data) end end |
.handle_with_controller(exception, controller = nil, request = nil) ⇒ Object
4 5 6 7 8 9 |
# File 'lib/exceptional/catcher.rb', line 4 def handle_with_controller(exception, controller=nil, request=nil) if Config.should_send_to_api? data = ControllerExceptionData.new(exception, controller, request) Remote.error(data) end end |
.handle_with_rack(exception, environment, request) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/exceptional/catcher.rb', line 11 def handle_with_rack(exception, environment, request) if Config.should_send_to_api? data = RackExceptionData.new(exception, environment, request) Remote.error(data) end end |