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.
73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/bunny/exceptions.rb', line 73 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.
71 72 73 |
# File 'lib/bunny/exceptions.rb', line 71 def hostname @hostname end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
71 72 73 |
# File 'lib/bunny/exceptions.rb', line 71 def port @port end |