Parent

Methods

Wait::BaseRescuer

Attributes

exceptions[R]
logger[RW]

Public Class Methods

new(exceptions) click to toggle source
# File lib/rescuers/base.rb, line 6
def initialize(exceptions)
  @exceptions = Array(exceptions).flatten
end

Public Instance Methods

log(exception) click to toggle source

Logs an exception.

# File lib/rescuers/base.rb, line 11
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
  # Indent the exception so it stands apart from the rest of the messages.
  backtrace = @logger.indent(exception.backtrace)

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

[Validate]

Generated with the Darkfish Rdoc Generator 2.