Exception: Amplitude::APIError

Inherits:
Error
  • Object
show all
Defined in:
lib/amplitude/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ APIError

Returns a new instance of APIError.



20
21
22
23
24
25
# File 'lib/amplitude/errors.rb', line 20

def initialize(response)
  super('The HTTP API returned an error')
  self.url = response.request.path.to_s
  self.code = response.code
  self.body = response.body
end

Instance Attribute Details

#body ⇒ Object

Returns the value of attribute body.



18
19
20
# File 'lib/amplitude/errors.rb', line 18

def body
  @body
end

#code ⇒ Object

Returns the value of attribute code.



18
19
20
# File 'lib/amplitude/errors.rb', line 18

def code
  @code
end

#url ⇒ Object

Returns the value of attribute url.



18
19
20
# File 'lib/amplitude/errors.rb', line 18

def url
  @url
end