Exception: BandwidthIris::Errors::GenericError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/bandwidth-iris/errors.rb

Overview

Generic error class

Instance Attribute Summary collapse

Instance Method Summary collapse

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 message = "HTTP Error\nStatus Code: #{@http_status}\nReason: #{@reason}\nHTTP Headers: #{@headers}\nResponse Body: #{@body}"
end

Instance Attribute Details

#bodyObject (readonly)

return [Hash] Body



15
16
17
# File 'lib/bandwidth-iris/errors.rb', line 15

def body
  @body
end

#codeString (readonly)

Returns Iris Error code.

Returns:

  • (String)

    Iris Error code



18
19
20
# File 'lib/bandwidth-iris/errors.rb', line 18

def code
  @code
end

#headersObject (readonly)

return [Hash] Headers



12
13
14
# File 'lib/bandwidth-iris/errors.rb', line 12

def headers
  @headers
end

#http_statusString (readonly)

Returns HTTP status code.

Returns:

  • (String)

    HTTP status code



6
7
8
# File 'lib/bandwidth-iris/errors.rb', line 6

def http_status
  @http_status
end

#reasonObject (readonly)

return [String] Reason



9
10
11
# File 'lib/bandwidth-iris/errors.rb', line 9

def reason
  @reason
end