Exception: CircuitApi::HttpError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/circuit_api/utils/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, body) ⇒ HttpError

Returns a new instance of HttpError.



5
6
7
8
# File 'lib/circuit_api/utils/errors.rb', line 5

def initialize(code, body)
  @error_code = code
  @error_body = body
end

Instance Attribute Details

#error_bodyObject (readonly)

Returns the value of attribute error_body.



3
4
5
# File 'lib/circuit_api/utils/errors.rb', line 3

def error_body
  @error_body
end

#error_codeObject (readonly)

Returns the value of attribute error_code.



3
4
5
# File 'lib/circuit_api/utils/errors.rb', line 3

def error_code
  @error_code
end

Instance Method Details

#messageObject



10
11
12
# File 'lib/circuit_api/utils/errors.rb', line 10

def message
  "HTTP #{error_code}. Error: #{error_body}"
end