Exception: InContact::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/incontact/error.rb

Direct Known Subclasses

ConnectionError, ResourceError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exception, response = nil) ⇒ Error

Returns a new instance of Error.



5
6
7
8
9
10
11
12
13
14
# File 'lib/incontact/error.rb', line 5

def initialize(exception, response = nil)
  @response = response
  if exception.instance_of? Faraday::Error::ClientError
    super exception.message
  elsif exception.is_a? String
    super exception
  else
    super "Unknown exception: #{exception.message}"
  end
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



3
4
5
# File 'lib/incontact/error.rb', line 3

def response
  @response
end