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.



353
354
355
356
357
358
359
360
# File 'lib/s4.rb', line 353

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.



351
352
353
# File 'lib/s4.rb', line 351

def code
  @code
end

#responseObject (readonly)

Returns the value of attribute response.



351
352
353
# File 'lib/s4.rb', line 351

def response
  @response
end

#statusObject (readonly)

Returns the value of attribute status.



351
352
353
# File 'lib/s4.rb', line 351

def status
  @status
end