Exception: MingleEvents::HttpError
- Inherits:
-
StandardError
- Object
- StandardError
- MingleEvents::HttpError
- Defined in:
- lib/mingle_events/http_error.rb
Instance Attribute Summary collapse
-
#additional_context ⇒ Object
readonly
Returns the value of attribute additional_context.
-
#requested_location ⇒ Object
readonly
Returns the value of attribute requested_location.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(response, requested_location, additional_context = nil) ⇒ HttpError
constructor
A new instance of HttpError.
- #not_found? ⇒ Boolean
Constructor Details
#initialize(response, requested_location, additional_context = nil) ⇒ HttpError
Returns a new instance of HttpError.
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/mingle_events/http_error.rb', line 7 def initialize(response, requested_location, additional_context = nil) super(%{ Unable to retrieve 200 response from URI: <#{requested_location}>! HTTP Code: #{response.code} Body: #{response.body} #{additional_context.nil? ? "" : additional_context} }) @response = response @requested_location = requested_location @additional_context = additional_context end |
Instance Attribute Details
#additional_context ⇒ Object (readonly)
Returns the value of attribute additional_context.
5 6 7 |
# File 'lib/mingle_events/http_error.rb', line 5 def additional_context @additional_context end |
#requested_location ⇒ Object (readonly)
Returns the value of attribute requested_location.
5 6 7 |
# File 'lib/mingle_events/http_error.rb', line 5 def requested_location @requested_location end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
5 6 7 |
# File 'lib/mingle_events/http_error.rb', line 5 def response @response end |
Instance Method Details
#not_found? ⇒ Boolean
19 20 21 22 |
# File 'lib/mingle_events/http_error.rb', line 19 def not_found? # has to be a better way to do this!! response.class == Net::HTTPNotFound end |