Exception: Bunny::TCPConnectionFailed
- Defined in:
- lib/bunny/exceptions.rb
Overview
Raised when TCP connection to RabbitMQ fails because of an unresolved hostname, connectivity problem, etc
Direct Known Subclasses
Instance Attribute Summary collapse
-
#hostname ⇒ Object
readonly
Returns the value of attribute hostname.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
Instance Method Summary collapse
-
#initialize(e, hostname = nil, port = nil) ⇒ TCPConnectionFailed
constructor
A new instance of TCPConnectionFailed.
Constructor Details
#initialize(e, hostname = nil, port = nil) ⇒ TCPConnectionFailed
Returns a new instance of TCPConnectionFailed
68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/bunny/exceptions.rb', line 68 def initialize(e, hostname=nil, port=nil) m = case e when String then e when ::Exception then e. end if hostname && port super("Could not establish TCP connection to #{hostname}:#{port}: #{m}") else super(m) end end |
Instance Attribute Details
#hostname ⇒ Object (readonly)
Returns the value of attribute hostname
66 67 68 |
# File 'lib/bunny/exceptions.rb', line 66 def hostname @hostname end |
#port ⇒ Object (readonly)
Returns the value of attribute port
66 67 68 |
# File 'lib/bunny/exceptions.rb', line 66 def port @port end |