Exception: CFC::Errors::HTTPError
- Inherits:
-
StandardError
- Object
- StandardError
- CFC::Errors::HTTPError
- Defined in:
- lib/cfc/errors/http_error.rb
Instance Attribute Summary collapse
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(request, response) ⇒ HTTPError
constructor
A new instance of HTTPError.
Constructor Details
#initialize(request, response) ⇒ HTTPError
Returns a new instance of HTTPError.
8 9 10 11 12 |
# File 'lib/cfc/errors/http_error.rb', line 8 def initialize(request, response) super "Cloudflare API request returned HTTP #{response.code}" @request = request @response = response end |
Instance Attribute Details
#request ⇒ Object (readonly)
Returns the value of attribute request.
6 7 8 |
# File 'lib/cfc/errors/http_error.rb', line 6 def request @request end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
6 7 8 |
# File 'lib/cfc/errors/http_error.rb', line 6 def response @response end |
Instance Method Details
#data ⇒ Object
14 15 16 |
# File 'lib/cfc/errors/http_error.rb', line 14 def data JSON.parse(@response.body) end |