Exception: Dialers::ErrorWithResponse

Inherits:
StandardError
  • Object
show all
Defined in:
lib/dialers/errors.rb

Instance Method Summary collapse

Constructor Details

#initialize(response = nil) ⇒ ErrorWithResponse


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

def initialize(response = nil)
  self.response = response
end

Instance Method Details

#messageObject


21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/dialers/errors.rb', line 21

def message
  if response.nil?
    super
  else
    "\n
    STATUS: #{response.status}
    URL: #{response.env.url}
    REQUEST HEADERS: #{response.env.request_headers}
    HEADERS: #{response.env.response_headers}
    BODY: #{response.body}\n\n"
  end
end