Module: Shutl::NetworkRetry

Extended by:
NetworkRetry
Included in:
NetworkRetry
Defined in:
lib/shutl/network_retry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#notifier_klassObject



24
25
26
# File 'lib/shutl/network_retry.rb', line 24

def notifier_klass
  @notifier_klass ||= Airbrake
end

Instance Method Details

#retry(message = "Notice: Network Exception", default = nil) ⇒ Object



15
16
17
18
19
20
# File 'lib/shutl/network_retry.rb', line 15

def retry message= "Notice: Network Exception", default=nil
  Retriable.retriable(retry_settings) { yield }
rescue *network_exceptions => e
  notifier_klass.notify(e, error_message: message)
  default
end