Exception: ChannelAdvisor::HTTPError

Inherits:
Error
  • Object
show all
Defined in:
lib/channeladvisor/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error_obj) ⇒ HTTPError

Returns a new instance of HTTPError.



19
20
21
22
23
24
25
# File 'lib/channeladvisor/error.rb', line 19

def initialize(error_obj)
  error = error_obj.to_hash
  @code = error[:code]
  message = "Failed with HTTP error #{@code}"

  super(message)
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



17
18
19
# File 'lib/channeladvisor/error.rb', line 17

def code
  @code
end