Exception: LoopsSdk::APIError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/loops_sdk/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status, body) ⇒ APIError

Returns a new instance of APIError.



45
46
47
48
49
# File 'lib/loops_sdk/base.rb', line 45

def initialize(status, body)
  @status = status
  @body = body
  super("API request failed with status #{status}: #{body}")
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



43
44
45
# File 'lib/loops_sdk/base.rb', line 43

def body
  @body
end

#statusObject (readonly)

Returns the value of attribute status.



43
44
45
# File 'lib/loops_sdk/base.rb', line 43

def status
  @status
end