Parent

Class/Module Index [+]

Quicksearch

Deltacloud::ExceptionHandler::ExceptionDef

Attributes

conditions[R]
handler[R]
message[RW]
status[RW]

Public Class Methods

new(conditions, &block) click to toggle source
# File lib/deltacloud/base_driver/exceptions.rb, line 88
def initialize(conditions, &block)
  @conditions = conditions
  instance_eval(&block) if block_given?
end

Public Instance Methods

exception(handler) click to toggle source
# File lib/deltacloud/base_driver/exceptions.rb, line 101
def exception(handler)
  self.handler = handler
end
match?(e) click to toggle source

Condition can be class or regexp

# File lib/deltacloud/base_driver/exceptions.rb, line 107
def match?(e)
  @conditions.each do |c|
    return true if c.class == Class && e.class == c
    return true if c.class == Regexp && (e.class.name =~ c or e.message =~ c)
  end
  return false
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.