class ErrorappNotifier::Notify
Public Class Methods
ignore?(exception, request)
click to toggle source
# File lib/errorapp_notifier/notify.rb, line 21 def ignore?(exception, request) ignore_class?(exception) || ignore_user_agent?(request) end
ignore_class?(exception)
click to toggle source
# File lib/errorapp_notifier/notify.rb, line 25 def ignore_class?(exception) config.ignore_exceptions.flatten.any? do |exception_class| exception_class === exception.class.to_s end end
ignore_user_agent?(request)
click to toggle source
# File lib/errorapp_notifier/notify.rb, line 31 def ignore_user_agent?(request) config.ignore_user_agents.flatten.any? do |user_agent| user_agent === request.user_agent.to_s end end
notify(exception, name = nil)
click to toggle source
# File lib/errorapp_notifier/notify.rb, line 16 def notify(exception, name = nil) data = FailureData.new(exception, name) notify_exception(exception, data) end
notify_with_controller(exception, controller = nil, request = nil)
click to toggle source
# File lib/errorapp_notifier/notify.rb, line 4 def notify_with_controller(exception, controller = nil, request = nil) data = ControllerFailureData.new(exception, controller, request) if data && !ignore?(exception, request) notify_exception(exception, data) end end
notify_with_rack(exception, environment, request)
click to toggle source
# File lib/errorapp_notifier/notify.rb, line 11 def notify_with_rack(exception, environment, request) data = RackFailureData.new(exception, environment, request) notify_exception(exception, data) end
Private Class Methods
config()
click to toggle source
# File lib/errorapp_notifier/notify.rb, line 51 def config ErrorappNotifier.configuration end
notify!(data)
click to toggle source
# File lib/errorapp_notifier/notify.rb, line 47 def notify!(data) Notifier.notify_error(data) end
notify_exception(exception, data)
click to toggle source
# File lib/errorapp_notifier/notify.rb, line 39 def notify_exception(exception, data) if config.should_send_to_api? notify!(data) else raise exception end end