Exception: BandwidthIris::Errors::GenericError
- Inherits:
-
StandardError
- Object
- StandardError
- BandwidthIris::Errors::GenericError
- Defined in:
- lib/bandwidth-iris/errors.rb
Overview
Generic error class
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
return [Hash] Body.
-
#code ⇒ String
readonly
Iris Error code.
-
#headers ⇒ Object
readonly
return [Hash] Headers.
-
#http_status ⇒ String
readonly
HTTP status code.
-
#reason ⇒ Object
readonly
return [String] Reason.
Instance Method Summary collapse
-
#initialize(http_status, reason, headers, body) ⇒ GenericError
constructor
private
A new instance of GenericError.
Constructor Details
#initialize(http_status, reason, headers, body) ⇒ GenericError
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of GenericError.
21 22 23 24 25 26 27 |
# File 'lib/bandwidth-iris/errors.rb', line 21 def initialize http_status, reason, headers, body @http_status = http_status @reason = reason @headers = headers @body = body super = "HTTP Error\nStatus Code: #{@http_status}\nReason: #{@reason}\nHTTP Headers: #{@headers}\nResponse Body: #{@body}" end |
Instance Attribute Details
#body ⇒ Object (readonly)
return [Hash] Body
15 16 17 |
# File 'lib/bandwidth-iris/errors.rb', line 15 def body @body end |
#code ⇒ String (readonly)
Returns Iris Error code.
18 19 20 |
# File 'lib/bandwidth-iris/errors.rb', line 18 def code @code end |
#headers ⇒ Object (readonly)
return [Hash] Headers
12 13 14 |
# File 'lib/bandwidth-iris/errors.rb', line 12 def headers @headers end |
#http_status ⇒ String (readonly)
Returns HTTP status code.
6 7 8 |
# File 'lib/bandwidth-iris/errors.rb', line 6 def http_status @http_status end |
#reason ⇒ Object (readonly)
return [String] Reason
9 10 11 |
# File 'lib/bandwidth-iris/errors.rb', line 9 def reason @reason end |