Class: WaitRescuer

Inherits:
Wait::BaseRescuer
  • Object
show all
Defined in:
lib/automan/wait_rescuer.rb

Instance Method Summary collapse

Constructor Details

#initialize(exceptions = nil) ⇒ WaitRescuer

Returns a new instance of WaitRescuer.



4
5
6
# File 'lib/automan/wait_rescuer.rb', line 4

def initialize(exceptions=nil)
  super
end

Instance Method Details

#log(exception) ⇒ Object

Logs an exception.



8
9
10
11
12
13
14
15
16
# File 'lib/automan/wait_rescuer.rb', line 8

def log(exception)
  return if @logger.nil?

  klass = exception.class.name
  # We can omit the message if it's identical to the class name.
  message = exception.message unless exception.message == klass

  @logger.debug("Rescuer") { "rescued: #{klass}#{": #{message}" if message}" }
end