Exception: S4::Error

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/s4.rb

Overview

Base class of all S3 Errors

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Error

Returns a new instance of Error.



357
358
359
360
361
362
363
364
# File 'lib/s4.rb', line 357

def initialize(response)
  @response = REXML::Document.new(response.body).elements["//Error"]

  @status = response.code
  @code = @response.elements["Code"].text

  super "#{@status}: #{@code} -- " + @response.elements["Message"].text
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



355
356
357
# File 'lib/s4.rb', line 355

def code
  @code
end

#responseObject (readonly)

Returns the value of attribute response.



355
356
357
# File 'lib/s4.rb', line 355

def response
  @response
end

#statusObject (readonly)

Returns the value of attribute status.



355
356
357
# File 'lib/s4.rb', line 355

def status
  @status
end