Exception: ContentfulLite::Client::RequestError
- Inherits:
-
StandardError
- Object
- StandardError
- ContentfulLite::Client::RequestError
- Defined in:
- lib/contentful_lite/client.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(response, body) ⇒ RequestError
constructor
A new instance of RequestError.
Constructor Details
#initialize(response, body) ⇒ RequestError
Returns a new instance of RequestError.
8 9 10 11 12 |
# File 'lib/contentful_lite/client.rb', line 8 def initialize(response, body) @response = response @body = body super(body['sys'] && body['sys']['type'] == 'Error' ? "#{body['sys']['id']}: #{body['message']}" : "Invalid Contentful Response: #{body}") end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
6 7 8 |
# File 'lib/contentful_lite/client.rb', line 6 def body @body end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
6 7 8 |
# File 'lib/contentful_lite/client.rb', line 6 def response @response end |