Exception: HeapAPI::ApiError

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

Overview

Raised when the Heap API server returns an error response.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ ApiError

Returns a new instance of ApiError.

Parameters:

  • response (Faraday::Response)

    the error response returned by the Heap analytics server



9
10
11
12
13
# File 'lib/heap/errors.rb', line 9

def initialize(response)
  @response = response

  super "Heap API server error: #{response.status} #{response.body}"
end

Instance Attribute Details

#responseFaraday::Response (readonly)

Returns response the error response returned by the Heap analytics server.

Returns:

  • (Faraday::Response)

    response the error response returned by the Heap analytics server



17
18
19
# File 'lib/heap/errors.rb', line 17

def response
  @response
end