Exception: Slash::ConnectionError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/slash/exceptions.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response, message = nil) ⇒ ConnectionError

Returns a new instance of ConnectionError.



5
6
7
8
# File 'lib/slash/exceptions.rb', line 5

def initialize(response, message = nil)
  @response = response
  @message  = message
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



3
4
5
# File 'lib/slash/exceptions.rb', line 3

def response
  @response
end

Instance Method Details

#to_sObject



10
11
12
# File 'lib/slash/exceptions.rb', line 10

def to_s
  "Failed with #{response.code} #{response.message if response.respond_to?(:message)}"
end