Exception: GorgonBunny::TCPConnectionFailed

Inherits:
Exception
  • Object
show all
Defined in:
lib/gorgon_bunny/lib/gorgon_bunny/exceptions.rb

Overview

Raised when TCP connection to RabbitMQ fails because of an unresolved hostname, connectivity problem, etc

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(e, hostname, port) ⇒ TCPConnectionFailed

Returns a new instance of TCPConnectionFailed.



51
52
53
54
55
56
57
58
59
# File 'lib/gorgon_bunny/lib/gorgon_bunny/exceptions.rb', line 51

def initialize(e, hostname, port)
  m = case e
      when String then
        e
      when Exception then
        e.message
      end
  super("Could not establish TCP connection to #{hostname}:#{port}: #{m}")
end

Instance Attribute Details

#hostnameObject (readonly)

Returns the value of attribute hostname.



49
50
51
# File 'lib/gorgon_bunny/lib/gorgon_bunny/exceptions.rb', line 49

def hostname
  @hostname
end

#portObject (readonly)

Returns the value of attribute port.



49
50
51
# File 'lib/gorgon_bunny/lib/gorgon_bunny/exceptions.rb', line 49

def port
  @port
end