Exception: DeltaCloud::HTTPError::ClientError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, message, opts = {}, backtrace = nil) ⇒ ClientError

Returns a new instance of ClientError.



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/errors.rb', line 23

def initialize(code, message, opts={}, backtrace=nil)
  @params, @driver, @provider = opts[:params], opts[:driver], opts[:provider]
  if code.to_s =~ /^5(\d{2})/
    message += "\nParameters: #{@params.inspect}\n"
    message += "Driver: #{@driver}@#{@provider}"
  end
  super("#{code}\n\n#{self.class.superclass}: #{message}\n\n")
  # If server provided us the backtrace, then replace client backtrace
  # with the server one.
  set_backtrace(backtrace) unless backtrace.nil?
end

Instance Attribute Details

#driverObject (readonly)

Returns the value of attribute driver.



21
22
23
# File 'lib/errors.rb', line 21

def driver
  @driver
end

#paramsObject (readonly)

Returns the value of attribute params.



21
22
23
# File 'lib/errors.rb', line 21

def params
  @params
end

#providerObject (readonly)

Returns the value of attribute provider.



21
22
23
# File 'lib/errors.rb', line 21

def provider
  @provider
end