Exception: CouchDB::HTTPError
- Defined in:
- lib/couchdb/errors.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Instance Method Summary collapse
-
#initialize(response) ⇒ HTTPError
constructor
A new instance of HTTPError.
Constructor Details
#initialize(response) ⇒ HTTPError
Returns a new instance of HTTPError.
84 85 86 87 88 89 |
# File 'lib/couchdb/errors.rb', line 84 def initialize(response) @code = response.code @body = JSON.parse response.body if response.body super @body ? @body['reason'] : @code end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
82 83 84 |
# File 'lib/couchdb/errors.rb', line 82 def body @body end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
82 83 84 |
# File 'lib/couchdb/errors.rb', line 82 def code @code end |