Exception: Leadtune::LeadtuneError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/leadtune.rb

Overview

Raised when non-2XX responses are received.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, message) ⇒ LeadtuneError

Returns a new instance of LeadtuneError.



24
25
26
# File 'lib/leadtune.rb', line 24

def initialize(code, message)
  @code, @message = code, message
end

Instance Attribute Details

#codeObject (readonly)

HTTP status code



19
20
21
# File 'lib/leadtune.rb', line 19

def code
  @code
end

#messageObject (readonly)

Any body text included with the response



22
23
24
# File 'lib/leadtune.rb', line 22

def message
  @message
end

Instance Method Details

#to_sObject

:nodoc:



28
29
30
# File 'lib/leadtune.rb', line 28

def to_s #:nodoc:
  "#{@code} #{message}"
end