lib/bunny/exceptions.rb in bunny-0.9.0.pre3 vs lib/bunny/exceptions.rb in bunny-0.9.0.pre4
- old
+ new
@@ -1,10 +1,16 @@
module Bunny
class TCPConnectionFailed < StandardError
attr_reader :hostname, :port
def initialize(e, hostname, port)
- super("Could not estabilish TCP connection to #{hostname}:#{port}: #{e.message}")
+ m = case e
+ when String then
+ e
+ when Exception then
+ e.message
+ end
+ super("Could not estabilish TCP connection to #{hostname}:#{port}: #{m}")
end
end
class ConnectionClosedError < StandardError
def initialize(frame)