Exception: S4::Error
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- S4::Error
- Defined in:
- lib/s4.rb
Overview
Base class of all S3 Errors
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(response) ⇒ Error
constructor
A new instance of Error.
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
#code ⇒ Object (readonly)
Returns the value of attribute code.
355 356 357 |
# File 'lib/s4.rb', line 355 def code @code end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
355 356 357 |
# File 'lib/s4.rb', line 355 def response @response end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
355 356 357 |
# File 'lib/s4.rb', line 355 def status @status end |