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.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(status, code, message) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(status, code, message) ⇒ Error
Returns a new instance of Error.
218 219 220 221 222 223 |
# File 'lib/s4.rb', line 218 def initialize(status, code, ) @status = status @code = code super "#{@code}: #{}" end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
208 209 210 |
# File 'lib/s4.rb', line 208 def code @code end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
208 209 210 |
# File 'lib/s4.rb', line 208 def status @status end |
Class Method Details
.from_response(response) ⇒ Object
210 211 212 213 214 215 216 |
# File 'lib/s4.rb', line 210 def self.from_response(response) doc = REXML::Document.new(response.body).elements["//Error"] code = doc.elements["Code"].text = doc.elements["Message"].text new response.code, code, end |